Commit 871ee9e7 authored by Over_score's avatar Over_score

Merge branch 'Fix-arcosh-issue' into 'master'

Fix arcosh issue

See merge request !503
parents dda7eeb5 99daf37a
......@@ -517,12 +517,12 @@ void convertAngle39FromTo(real_t *angle, uint32_t fromAngularMode, uint32_t toAn
realSubtract(angle, &minutes, angle, &ctxtReal39);
realMultiply(angle, const_100, &seconds, &ctxtReal39);
if(real39CompareGreaterEqual(&seconds, const_60)) {
if(realCompareGreaterEqual(&seconds, const_60)) {
realSubtract(&seconds, const_60, &seconds, &ctxtReal39);
realAdd(&minutes, const_1, &minutes, &ctxtReal39);
}
if(real39CompareGreaterEqual(&minutes, const_60)) {
if(realCompareGreaterEqual(&minutes, const_60)) {
realSubtract(&minutes, const_60, &minutes, &ctxtReal39);
realAdd(&degrees, const_1, &degrees, &ctxtReal39);
}
......@@ -635,12 +635,12 @@ void checkDms16(real16_t *angle16Dms) {
realMultiply(&angleDms, const_100, &seconds, &ctxtReal39);
if(real39CompareGreaterEqual(&seconds, const_60)) {
if(realCompareGreaterEqual(&seconds, const_60)) {
realSubtract(&seconds, const_60, &seconds, &ctxtReal39);
realAdd(&minutes, const_1, &minutes, &ctxtReal39);
}
if(real39CompareGreaterEqual(&minutes, const_60)) {
if(realCompareGreaterEqual(&minutes, const_60)) {
realSubtract(&minutes, const_60, &minutes, &ctxtReal39);
realAdd(&degrees, const_1, &degrees, &ctxtReal39);
}
......@@ -677,12 +677,12 @@ void checkDms34(real34_t *angle34Dms) {
realMultiply(&angleDms, const_100, &seconds, &ctxtReal39);
if(real39CompareGreaterEqual(&seconds, const_60)) {
if(realCompareGreaterEqual(&seconds, const_60)) {
realSubtract(&seconds, const_60, &seconds, &ctxtReal39);
realAdd(&minutes, const_1, &minutes, &ctxtReal39);
}
if(real39CompareGreaterEqual(&minutes, const_60)) {
if(realCompareGreaterEqual(&minutes, const_60)) {
realSubtract(&minutes, const_60, &minutes, &ctxtReal39);
realAdd(&degrees, const_1, &degrees, &ctxtReal39);
}
......
......@@ -239,6 +239,7 @@ typedef struct {real75_t real, imag;} complex75_t;
#define realIsPositive(source) (((((real_t *)(source))->bits) & 0x80) == 0x00)
#define realIsSpecial(source) decNumberIsSpecial ((real_t *)(source))
#define realIsZero(source) decNumberIsZero ((real_t *)(source))
#define realLn(operand, res, ctxt) decNumberLn ((real_t *)(res), (real_t *)(operand), ctxt)
#define realMinus(operand, res, ctxt) decNumberMinus ((real_t *)(res), (real_t *)(operand), ctxt)
#define realMultiply(operand1, operand2, res, ctxt) decNumberMultiply ((real_t *)(res), (real_t *)(operand1), (real_t *)(operand2), ctxt)
#define realNextToward(from, toward, res, ctxt) decNumberNextToward ((real_t *)(res), (real_t *)(from), (real_t *)(toward), ctxt)
......
......@@ -74,7 +74,7 @@ void fnDenMax(uint16_t unusedParamButMandatory) {
return;
}
if(realIsSpecial(&reX) || real39CompareLessThan(&reX, const_1) || real39CompareGreaterEqual(&reX, const_9999)) {
if(realIsSpecial(&reX) || realCompareLessThan(&reX, const_1) || realCompareGreaterEqual(&reX, const_9999)) {
denMax = DM_DENMAX;
}
else {
......
......@@ -68,7 +68,7 @@ void arccosLonI(void) {
real39_t x;
convertLongIntegerRegisterToReal(REGISTER_X, &x, &ctxtReal39);
if(real39CompareAbsGreaterThan(&x, const_1)) {
if(realCompareAbsGreaterThan(&x, const_1)) {
if(getFlag(FLAG_CPXRES)) {
reallocateRegister(REGISTER_X, dtComplex34, COMPLEX34_SIZE, AM_NONE);
realToReal34(&x, REGISTER_REAL34_DATA(REGISTER_X));
......@@ -119,7 +119,7 @@ void arccosRe16(void) {
real16ToReal(REGISTER_REAL16_DATA(REGISTER_X), &x);
setRegisterAngularMode(REGISTER_X, currentAngularMode);
if(real39CompareAbsGreaterThan(&x, const_1)) {
if(realCompareAbsGreaterThan(&x, const_1)) {
if(getFlag(FLAG_CPXRES)) {
reallocateRegister(REGISTER_X, dtComplex34, COMPLEX34_SIZE, AM_NONE);
realToReal34(&x, REGISTER_REAL34_DATA(REGISTER_X));
......@@ -223,7 +223,7 @@ void arccosRe34(void) {
real34ToReal(REGISTER_REAL34_DATA(REGISTER_X), &x);
setRegisterAngularMode(REGISTER_X, currentAngularMode);
if(real39CompareAbsGreaterThan(&x, const_1)) {
if(realCompareAbsGreaterThan(&x, const_1)) {
if(getFlag(FLAG_CPXRES)) {
reallocateRegister(REGISTER_X, dtComplex34, COMPLEX34_SIZE, AM_NONE);
realToReal34(&x, REGISTER_REAL34_DATA(REGISTER_X));
......
......@@ -68,7 +68,7 @@ void arccoshLonI(void) {
real39_t x, xSquared;
convertLongIntegerRegisterToReal(REGISTER_X, &x, &ctxtReal39);
if(real39CompareLessThan(&x, const_1)) {
if(realCompareLessThan(&x, const_1)) {
if(getFlag(FLAG_CPXRES)) {
reallocateRegister(REGISTER_X, dtComplex34, COMPLEX34_SIZE, AM_NONE);
realToReal34(&x, REGISTER_REAL34_DATA(REGISTER_X));
......@@ -113,7 +113,7 @@ void arccoshRe16(void) {
real16ToReal(REGISTER_REAL16_DATA(REGISTER_X), &x);
if(real39CompareLessThan(&x, const_1)) {
if(realCompareLessThan(&x, const_1)) {
if(getFlag(FLAG_CPXRES)) {
reallocateRegister(REGISTER_X, dtComplex34, COMPLEX34_SIZE, AM_NONE);
realToReal34(&x, REGISTER_REAL34_DATA(REGISTER_X));
......@@ -213,11 +213,11 @@ void arccoshRe34(void) {
return;
}
real39_t x, xSquared;
real75_t x, xSquared;
real34ToReal(REGISTER_REAL34_DATA(REGISTER_X), &x);
if(real39CompareLessThan(&x, const_1)) {
if(realCompareLessThan((real_t *)&x, const_1)) {
if(getFlag(FLAG_CPXRES)) {
reallocateRegister(REGISTER_X, dtComplex34, COMPLEX34_SIZE, AM_NONE);
realToReal34(&x, REGISTER_REAL34_DATA(REGISTER_X));
......@@ -236,11 +236,12 @@ void arccoshRe34(void) {
}
// arccosh(x) = ln(x + sqrt(x - 1))
realMultiply(&x, &x, &xSquared, &ctxtReal39);
realSubtract(&xSquared, const_1, &xSquared, &ctxtReal39);
realSquareRoot(&xSquared, &xSquared, &ctxtReal39);
realAdd(&xSquared, &x, &x, &ctxtReal39);
WP34S_Ln(&x, &x);
realMultiply(&x, &x, &xSquared, &ctxtReal75);
realSubtract(&xSquared, const_1, &xSquared, &ctxtReal75);
realSquareRoot(&xSquared, &xSquared, &ctxtReal75);
realAdd(&xSquared, &x, &x, &ctxtReal75);
realLn(&x, &x, &ctxtReal75);
//WP34S_Ln(&x, &x);
realToReal34(&x, REGISTER_REAL34_DATA(REGISTER_X));
setRegisterAngularMode(REGISTER_X, AM_NONE);
......
......@@ -68,7 +68,7 @@ void arcsinLonI(void) {
real39_t x;
convertLongIntegerRegisterToReal(REGISTER_X, &x, &ctxtReal39);
if(real39CompareAbsGreaterThan(&x, const_1)) {
if(realCompareAbsGreaterThan(&x, const_1)) {
if(getFlag(FLAG_CPXRES)) {
reallocateRegister(REGISTER_X, dtComplex34, COMPLEX34_SIZE, AM_NONE);
realToReal34(&x, REGISTER_REAL34_DATA(REGISTER_X));
......@@ -116,7 +116,7 @@ void arcsinRe16(void) {
real16ToReal(REGISTER_REAL16_DATA(REGISTER_X), &x);
setRegisterAngularMode(REGISTER_X, currentAngularMode);
if(real39CompareAbsGreaterThan(&x, const_1)) {
if(realCompareAbsGreaterThan(&x, const_1)) {
if(getFlag(FLAG_CPXRES)) {
reallocateRegister(REGISTER_X, dtComplex34, COMPLEX34_SIZE, AM_NONE);
realToReal34(&x, REGISTER_REAL34_DATA(REGISTER_X));
......@@ -223,7 +223,7 @@ void arcsinRe34(void) {
real34ToReal(REGISTER_REAL34_DATA(REGISTER_X), &x);
setRegisterAngularMode(REGISTER_X, currentAngularMode);
if(real39CompareAbsGreaterThan(&x, const_1)) {
if(realCompareAbsGreaterThan(&x, const_1)) {
if(getFlag(FLAG_CPXRES)) {
reallocateRegister(REGISTER_X, dtComplex34, COMPLEX34_SIZE, AM_NONE);
realToReal34(&x, REGISTER_REAL34_DATA(REGISTER_X));
......
......@@ -74,7 +74,7 @@ void arctanhLonI(void) {
real16Zero(REGISTER_REAL16_DATA(REGISTER_X));
}
else {
if(real39CompareEqual(&x, const_1)) {
if(realCompareEqual(&x, const_1)) {
if(getFlag(FLAG_DANGER)) {
reallocateRegister(REGISTER_X, dtReal16, REAL16_SIZE, AM_NONE);
realToReal16(const_plusInfinity, REGISTER_REAL16_DATA(REGISTER_X));
......@@ -86,7 +86,7 @@ void arctanhLonI(void) {
#endif
}
}
else if(real39CompareEqual(&x, const__1)) {
else if(realCompareEqual(&x, const__1)) {
if(getFlag(FLAG_DANGER)) {
reallocateRegister(REGISTER_X, dtReal16, REAL16_SIZE, AM_NONE);
realToReal16(const_minusInfinity, REGISTER_REAL16_DATA(REGISTER_X));
......@@ -135,7 +135,7 @@ void arctanhRe16(void) {
real16Zero(REGISTER_REAL16_DATA(REGISTER_X));
}
else {
if(real39CompareEqual(&x, const_1)) {
if(realCompareEqual(&x, const_1)) {
if(getFlag(FLAG_DANGER)) {
realToReal16(const_plusInfinity, REGISTER_REAL16_DATA(REGISTER_X));
}
......@@ -146,7 +146,7 @@ void arctanhRe16(void) {
#endif
}
}
else if(real39CompareEqual(&x, const__1)) {
else if(realCompareEqual(&x, const__1)) {
if(getFlag(FLAG_DANGER)) {
realToReal16(const_minusInfinity, REGISTER_REAL16_DATA(REGISTER_X));
}
......@@ -158,7 +158,7 @@ void arctanhRe16(void) {
}
}
else {
if(real39CompareAbsGreaterThan(&x, const_1)) {
if(realCompareAbsGreaterThan(&x, const_1)) {
if(getFlag(FLAG_CPXRES)) {
reallocateRegister(REGISTER_X, dtComplex34, COMPLEX34_SIZE, AM_NONE);
realToReal34(&x, REGISTER_REAL34_DATA(REGISTER_X));
......@@ -255,7 +255,7 @@ void arctanhRe34(void) {
real34Zero(REGISTER_REAL34_DATA(REGISTER_X));
}
else {
if(real39CompareEqual(&x, const_1)) {
if(realCompareEqual(&x, const_1)) {
if(getFlag(FLAG_DANGER)) {
realToReal34(const_plusInfinity, REGISTER_REAL34_DATA(REGISTER_X));
}
......@@ -266,7 +266,7 @@ void arctanhRe34(void) {
#endif
}
}
else if(real39CompareEqual(&x, const__1)) {
else if(realCompareEqual(&x, const__1)) {
if(getFlag(FLAG_DANGER)) {
realToReal34(const_minusInfinity, REGISTER_REAL34_DATA(REGISTER_X));
}
......@@ -278,7 +278,7 @@ void arctanhRe34(void) {
}
}
else {
if(real39CompareAbsGreaterThan(&x, const_1)) {
if(realCompareAbsGreaterThan(&x, const_1)) {
if(getFlag(FLAG_CPXRES)) {
reallocateRegister(REGISTER_X, dtComplex34, COMPLEX34_SIZE, AM_NONE);
realToReal34(&x, REGISTER_REAL34_DATA(REGISTER_X));
......
......@@ -156,94 +156,94 @@ bool_t real34CompareLessThan(const real34_t *number1, const real34_t *number2) {
bool_t real39CompareAbsGreaterThan(const real_t *number1, const real_t *number2) {
real39_t compare, num1, num2;
bool_t realCompareAbsGreaterThan(const real_t *number1, const real_t *number2) {
real75_t compare, num1, num2;
int32_t cmp;
realCopyAbs(number1, &num1);
realCopyAbs(number2, &num2);
realCompare(&num1, &num2, &compare, &ctxtReal39);
realCompare(&num1, &num2, &compare, &ctxtReal75);
realToInt32(&compare, cmp);
return cmp > 0;
}
bool_t real39CompareAbsGreaterEqual(const real_t *number1, const real_t *number2) {
real39_t compare, num1, num2;
bool_t realCompareAbsGreaterEqual(const real_t *number1, const real_t *number2) {
real75_t compare, num1, num2;
int32_t cmp;
realCopyAbs(number1, &num1);
realCopyAbs(number2, &num2);
realCompare(&num1, &num2, &compare, &ctxtReal39);
realCompare(&num1, &num2, &compare, &ctxtReal75);
realToInt32(&compare, cmp);
return cmp >= 0;
}
bool_t real39CompareAbsLessThan(const real_t *number1, const real_t *number2) {
real39_t compare, num1, num2;
bool_t realCompareAbsLessThan(const real_t *number1, const real_t *number2) {
real75_t compare, num1, num2;
int32_t cmp;
realCopyAbs(number1, &num1);
realCopyAbs(number2, &num2);
realCompare(&num1, &num2, &compare, &ctxtReal39);
realCompare(&num1, &num2, &compare, &ctxtReal75);
realToInt32(&compare, cmp);
return cmp < 0;
}
bool_t real39CompareEqual(const real_t *number1, const real_t *number2) {
real39_t compare;
bool_t realCompareEqual(const real_t *number1, const real_t *number2) {
real75_t compare;
int32_t cmp;
realCompare(number1, number2, &compare, &ctxtReal39);
realCompare(number1, number2, &compare, &ctxtReal75);
realToInt32(&compare, cmp);
return cmp == 0;
}
bool_t real39CompareGreaterEqual(const real_t *number1, const real_t *number2) {
real39_t compare;
bool_t realCompareGreaterEqual(const real_t *number1, const real_t *number2) {
real75_t compare;
int32_t cmp;
realCompare(number1, number2, &compare, &ctxtReal39);
realCompare(number1, number2, &compare, &ctxtReal75);
realToInt32(&compare, cmp);
return cmp >= 0;
}
bool_t real39CompareGreaterThan(const real_t *number1, const real_t *number2) {
real39_t compare;
bool_t realCompareGreaterThan(const real_t *number1, const real_t *number2) {
real75_t compare;
int32_t cmp;
realCompare(number1, number2, &compare, &ctxtReal39);
realCompare(number1, number2, &compare, &ctxtReal75);
realToInt32(&compare, cmp);
return cmp > 0;
}
bool_t real39CompareLessEqual(const real_t *number1, const real_t *number2) {
real39_t compare;
bool_t realCompareLessEqual(const real_t *number1, const real_t *number2) {
real75_t compare;
int32_t cmp;
realCompare(number1, number2, &compare, &ctxtReal39);
realCompare(number1, number2, &compare, &ctxtReal75);
realToInt32(&compare, cmp);
return cmp <= 0;
}
bool_t real39CompareLessThan(const real_t *number1, const real_t *number2) {
real39_t compare;
bool_t realCompareLessThan(const real_t *number1, const real_t *number2) {
real75_t compare;
int32_t cmp;
realCompare(number1, number2, &compare, &ctxtReal39);
realCompare(number1, number2, &compare, &ctxtReal75);
realToInt32(&compare, cmp);
return cmp < 0;
}
......@@ -288,8 +288,8 @@ bool_t real34IsAnInteger(const real34_t *x) {
bool_t real39IsAnInteger(const real_t *x) {
real39_t r, y;
bool_t realIsAnInteger(const real_t *x) {
real75_t r, y;
if(realIsNaN(x)) {
return false;
......@@ -299,10 +299,10 @@ bool_t real39IsAnInteger(const real_t *x) {
return true;
}
realToIntegralValue(x, &y, DEC_ROUND_DOWN, &ctxtReal39);
realSubtract(x, &y, &r, &ctxtReal39);
realToIntegralValue(x, &y, DEC_ROUND_DOWN, &ctxtReal75);
realSubtract(x, &y, &r, &ctxtReal75);
return real39CompareEqual(&r, const_0);
return realCompareEqual((real_t *)&r, const_0);
}
......
......@@ -35,15 +35,15 @@ bool_t real34CompareGreaterThan (const real34_t *number1, const real34_t *nu
bool_t real34CompareLessEqual (const real34_t *number1, const real34_t *number2);
bool_t real34CompareLessThan (const real34_t *number1, const real34_t *number2);
bool_t real39CompareAbsGreaterThan (const real_t *number1, const real_t *number2);
bool_t real39CompareAbsLessThan (const real_t *number1, const real_t *number2);
bool_t real39CompareEqual (const real_t *number1, const real_t *number2);
bool_t real39CompareGreaterEqual (const real_t *number1, const real_t *number2);
bool_t real39CompareGreaterThan (const real_t *number1, const real_t *number2);
bool_t real39CompareLessEqual (const real_t *number1, const real_t *number2);
bool_t real39CompareLessThan (const real_t *number1, const real_t *number2);
bool_t realCompareAbsGreaterThan (const real_t *number1, const real_t *number2);
bool_t realCompareAbsLessThan (const real_t *number1, const real_t *number2);
bool_t realCompareEqual (const real_t *number1, const real_t *number2);
bool_t realCompareGreaterEqual (const real_t *number1, const real_t *number2);
bool_t realCompareGreaterThan (const real_t *number1, const real_t *number2);
bool_t realCompareLessEqual (const real_t *number1, const real_t *number2);
bool_t realCompareLessThan (const real_t *number1, const real_t *number2);
bool_t real16IsAnInteger (const real16_t *x);
bool_t real34IsAnInteger (const real34_t *x);
bool_t real39IsAnInteger (const real_t *x);
bool_t realIsAnInteger (const real_t *x);
int16_t realIdenticalDigits (real_t *a, real_t *b);
......@@ -123,7 +123,7 @@ void gammaLonI(void) {
return;
}
if(real39CompareLessEqual(&x, const_0)) { // x <= 0 and is an integer
if(realCompareLessEqual(&x, const_0)) { // x <= 0 and is an integer
if(!getFlag(FLAG_DANGER)) {
displayCalcErrorMessage(ERROR_ARG_EXCEEDS_FUNCTION_DOMAIN, ERR_REGISTER_LINE, REGISTER_X);
#if (EXTRA_INFO_ON_CALC_ERROR == 1)
......@@ -161,7 +161,7 @@ void lnGammaLonI(void) {
return;
}
if(real39CompareLessEqual(&x, const_0)) { // x <= 0 and is an integer
if(realCompareLessEqual(&x, const_0)) { // x <= 0 and is an integer
if(!getFlag(FLAG_DANGER)) {
displayCalcErrorMessage(ERROR_ARG_EXCEEDS_FUNCTION_DOMAIN, ERR_REGISTER_LINE, REGISTER_X);
#if (EXTRA_INFO_ON_CALC_ERROR == 1)
......@@ -253,8 +253,8 @@ void lnGammaRe16(void) {
return;
}
if(real39CompareLessEqual(&x.real, const_0)) { // x <= 0
if(real39IsAnInteger(&x.real)) {
if(realCompareLessEqual(&x.real, const_0)) { // x <= 0
if(realIsAnInteger(&x.real)) {
if(!getFlag(FLAG_DANGER)) {
displayCalcErrorMessage(ERROR_ARG_EXCEEDS_FUNCTION_DOMAIN, ERR_REGISTER_LINE, REGISTER_X);
#if (EXTRA_INFO_ON_CALC_ERROR == 1)
......@@ -269,7 +269,7 @@ void lnGammaRe16(void) {
else { // x is negative and not an integer
realMinus(&x.real, &x.imag, &ctxtReal39); // x.imag is used as a temp variable here
realDivideRemainder(&x.imag, const_2, &x.imag, &ctxtReal39);
if(real39CompareGreaterThan(&x.imag, const_1)) { // the result is a real
if(realCompareGreaterThan(&x.imag, const_1)) { // the result is a real
WP34S_LnGamma(&x.real, &x.real);
realToReal16(&x.real, REGISTER_REAL16_DATA(REGISTER_X));
}
......@@ -416,8 +416,8 @@ void lnGammaRe34(void) {
return;
}
if(real39CompareLessEqual(&x.real, const_0)) { // x <= 0
if(real39IsAnInteger(&x.real)) {
if(realCompareLessEqual(&x.real, const_0)) { // x <= 0
if(realIsAnInteger(&x.real)) {
if(!getFlag(FLAG_DANGER)) {
displayCalcErrorMessage(ERROR_ARG_EXCEEDS_FUNCTION_DOMAIN, ERR_REGISTER_LINE, REGISTER_X);
#if (EXTRA_INFO_ON_CALC_ERROR == 1)
......@@ -432,7 +432,7 @@ void lnGammaRe34(void) {
else { // x is negative and not an integer
realMinus(&x.real, &x.imag, &ctxtReal39); // x.imag is used as a temp variable here
realDivideRemainder(&x.imag, const_2, &x.imag, &ctxtReal39);
if(real39CompareGreaterThan(&x.imag, const_1)) { // the result is a real
if(realCompareGreaterThan(&x.imag, const_1)) { // the result is a real
WP34S_LnGamma(&x.real, &x.real);
realToReal34(&x.real, REGISTER_REAL34_DATA(REGISTER_X));
}
......
......@@ -56,7 +56,7 @@ void fnMax(uint16_t unusedParamButMandatory) {
convertLongIntegerRegisterToReal(REGISTER_X, (real_t *)&x, &ctxtReal39);
real16ToReal(REGISTER_REAL16_DATA(REGISTER_Y), &y);
if(real39CompareGreaterThan(&y, &x)) {
if(realCompareGreaterThan(&y, &x)) {
copySourceRegisterToDestRegister(REGISTER_Y, REGISTER_X);
}
break;
......@@ -84,7 +84,7 @@ void fnMax(uint16_t unusedParamButMandatory) {
convertLongIntegerRegisterToReal(REGISTER_X, (real_t *)&x, &ctxtReal39);
real34ToReal(REGISTER_REAL34_DATA(REGISTER_Y), &y);
if(real39CompareGreaterThan(&y, &x)) {
if(realCompareGreaterThan(&y, &x)) {
copySourceRegisterToDestRegister(REGISTER_Y, REGISTER_X);
}
break;
......@@ -113,7 +113,7 @@ void fnMax(uint16_t unusedParamButMandatory) {
// X = real16 Y = long integer
real16ToReal(REGISTER_REAL16_DATA(REGISTER_X), &x);
convertLongIntegerRegisterToReal(REGISTER_Y, (real_t *)&y, &ctxtReal39);
if(real39CompareGreaterThan(&y, &x)) {
if(realCompareGreaterThan(&y, &x)) {
copySourceRegisterToDestRegister(REGISTER_Y, REGISTER_X);
}
break;
......@@ -137,7 +137,7 @@ void fnMax(uint16_t unusedParamButMandatory) {
// X = real16 Y = short integer
real16ToReal(REGISTER_REAL16_DATA(REGISTER_X), &x);
convertShortIntegerRegisterToReal(REGISTER_Y, (real_t *)&y, &ctxtReal39);
if(real39CompareGreaterThan(&y, &x)) {
if(realCompareGreaterThan(&y, &x)) {
copySourceRegisterToDestRegister(REGISTER_Y, REGISTER_X);
}
break;
......@@ -154,7 +154,7 @@ void fnMax(uint16_t unusedParamButMandatory) {
real16ToReal(REGISTER_REAL16_DATA(REGISTER_X), &x);
real34ToReal(REGISTER_REAL34_DATA(REGISTER_Y), &y);
if(real39CompareGreaterThan(&y, &x)) {
if(realCompareGreaterThan(&y, &x)) {
copySourceRegisterToDestRegister(REGISTER_Y, REGISTER_X);
}
break;
......@@ -238,7 +238,7 @@ void fnMax(uint16_t unusedParamButMandatory) {
convertShortIntegerRegisterToReal(REGISTER_X, (real_t *)&x, &ctxtReal39);
real16ToReal(REGISTER_REAL16_DATA(REGISTER_Y), &y);
if(real39CompareGreaterThan(&y, &x)) {
if(realCompareGreaterThan(&y, &x)) {
copySourceRegisterToDestRegister(REGISTER_Y, REGISTER_X);
}
break;
......@@ -266,7 +266,7 @@ void fnMax(uint16_t unusedParamButMandatory) {
convertShortIntegerRegisterToReal(REGISTER_X, (real_t *)&x, &ctxtReal39);
real34ToReal(REGISTER_REAL34_DATA(REGISTER_Y), &y);
if(real39CompareGreaterThan(&y, &x)) {
if(realCompareGreaterThan(&y, &x)) {
copySourceRegisterToDestRegister(REGISTER_Y, REGISTER_X);
}
break;
......@@ -295,7 +295,7 @@ void fnMax(uint16_t unusedParamButMandatory) {
// X = real34 Y = long integer
real34ToReal(REGISTER_REAL34_DATA(REGISTER_X), &x);
convertLongIntegerRegisterToReal(REGISTER_Y, (real_t *)&y, &ctxtReal39);
if(real39CompareGreaterThan(&y, &x)) {
if(realCompareGreaterThan(&y, &x)) {
copySourceRegisterToDestRegister(REGISTER_Y, REGISTER_X);
}
break;
......@@ -312,7 +312,7 @@ void fnMax(uint16_t unusedParamButMandatory) {
real34ToReal(REGISTER_REAL34_DATA(REGISTER_X), &x);
real16ToReal(REGISTER_REAL16_DATA(REGISTER_Y), &y);
if(real39CompareGreaterThan(&y, &x)) {
if(realCompareGreaterThan(&y, &x)) {
copySourceRegisterToDestRegister(REGISTER_Y, REGISTER_X);
}
break;
......@@ -321,7 +321,7 @@ void fnMax(uint16_t unusedParamButMandatory) {
// X = real34 Y = short integer
real34ToReal(REGISTER_REAL34_DATA(REGISTER_X), &x);
convertShortIntegerRegisterToReal(REGISTER_Y, (real_t *)&y, &ctxtReal39);
if(real39CompareGreaterThan(&y, &x)) {
if(realCompareGreaterThan(&y, &x)) {
copySourceRegisterToDestRegister(REGISTER_Y, REGISTER_X);
}
break;
......
......@@ -56,7 +56,7 @@ void fnMin(uint16_t unusedParamButMandatory) {
convertLongIntegerRegisterToReal(REGISTER_X, (real_t *)&x, &ctxtReal39);
real16ToReal(REGISTER_REAL16_DATA(REGISTER_Y), &y);
if(real39CompareLessThan(&y, &x)) {
if(realCompareLessThan(&y, &x)) {
copySourceRegisterToDestRegister(REGISTER_Y, REGISTER_X);
}
break;
......@@ -84,7 +84,7 @@ void fnMin(uint16_t unusedParamButMandatory) {
convertLongIntegerRegisterToReal(REGISTER_X, (real_t *)&x, &ctxtReal39);
real34ToReal(REGISTER_REAL34_DATA(REGISTER_Y), &y);
if(real39CompareLessThan(&y, &x)) {
if(realCompareLessThan(&y, &x)) {
copySourceRegisterToDestRegister(REGISTER_Y, REGISTER_X);
}
break;
......@@ -113,7 +113,7 @@ void fnMin(uint16_t unusedParamButMandatory) {
// X = real16 Y = long integer
real16ToReal(REGISTER_REAL16_DATA(REGISTER_X), &x);
convertLongIntegerRegisterToReal(REGISTER_Y, (real_t *)&y, &ctxtReal39);
if(real39CompareLessThan(&y, &x)) {
if(realCompareLessThan(&y, &x)) {
copySourceRegisterToDestRegister(REGISTER_Y, REGISTER_X);
}
break;
......@@ -137,7 +137,7 @@ void fnMin(uint16_t unusedParamButMandatory) {
// X = real16 Y = short integer
real16ToReal(REGISTER_REAL16_DATA(REGISTER_X), &x);
convertShortIntegerRegisterToReal(REGISTER_Y, (real_t *)&y, &ctxtReal39);
if(real39CompareLessThan(&y, &x)) {
if(realCompareLessThan(&y, &x)) {
copySourceRegisterToDestRegister(REGISTER_Y, REGISTER_X);
}
break;
......@@ -154,7 +154,7 @@ void fnMin(uint16_t unusedParamButMandatory) {
real16ToReal(REGISTER_REAL16_DATA(REGISTER_X), &x);
real34ToReal(REGISTER_REAL34_DATA(REGISTER_Y), &y);
if(real39CompareLessThan(&y, &x)) {
if(realCompareLessThan(&y, &x)) {
copySourceRegisterToDestRegister(REGISTER_Y, REGISTER_X);
}
break;
......@@ -238,7 +238,7 @@ void fnMin(uint16_t unusedParamButMandatory) {
convertShortIntegerRegisterToReal(REGISTER_X, (real_t *)&x, &ctxtReal39);
real16ToReal(REGISTER_REAL16_DATA(REGISTER_Y), &y);
if(real39CompareLessThan(&y, &x)) {
if(realCompareLessThan(&y, &x)) {
copySourceRegisterToDestRegister(REGISTER_Y, REGISTER_X);
}
break;
......@@ -266,7 +266,7 @@ void fnMin(uint16_t unusedParamButMandatory) {
convertShortIntegerRegisterToReal(REGISTER_X, (real_t *)&x, &ctxtReal39);
real34ToReal(REGISTER_REAL34_DATA(REGISTER_Y), &y);
if(real39CompareLessThan(&y, &x)) {
if(realCompareLessThan(&y, &x)) {
copySourceRegisterToDestRegister(REGISTER_Y, REGISTER_X);
}
break;
......@@ -295,7 +295,7 @@ void fnMin(uint16_t unusedParamButMandatory) {
// X = real34 Y = long integer
real34ToReal(REGISTER_REAL34_DATA(REGISTER_X), &x);
convertLongIntegerRegisterToReal(REGISTER_Y, (real_t *)&y, &ctxtReal39);
if(real39CompareLessThan(&y, &x)) {
if(realCompareLessThan(&y, &x)) {
copySourceRegisterToDestRegister(REGISTER_Y, REGISTER_X);
}
break;
......@@ -312,7 +312,7 @@ void fnMin(uint16_t unusedParamButMandatory) {
real34ToReal(REGISTER_REAL34_DATA(REGISTER_X), &x);
real16ToReal(REGISTER_REAL16_DATA(REGISTER_Y), &y);
if(real39CompareLessThan(&y, &x)) {
if(realCompareLessThan(&y, &x)) {
copySourceRegisterToDestRegister(REGISTER_Y, REGISTER_X);
}
break;
......@@ -321,7 +321,7 @@ void fnMin(uint16_t unusedParamButMandatory) {
// X = real34 Y = short integer
real34ToReal(REGISTER_REAL34_DATA(REGISTER_X), &x);
convertShortIntegerRegisterToReal(REGISTER_Y, (real_t *)&y, &ctxtReal39);
if(real39CompareLessThan(&y, &x)) {
if(realCompareLessThan(&y, &x)) {
copySourceRegisterToDestRegister(REGISTER_Y, REGISTER_X);
}
break;
......
......@@ -71,7 +71,7 @@ void fnNeighb(uint16_t unusedParamButMandatory) {
convertLongIntegerRegisterToReal(REGISTER_X, (real_t *)&x, &ctxtReal39);
real16ToReal(REGISTER_REAL16_DATA(REGISTER_Y), &y);
longIntegerInit(lgIntY);
intToLongInteger(real39CompareEqual(&y, &x) ? 0 : (real39CompareGreaterThan(&y, &x) ? 1 : -1), lgIntY);
intToLongInteger(realCompareEqual(&y, &x) ? 0 : (realCompareGreaterThan(&y, &x) ? 1 : -1), lgIntY);
break;
case dtShortInteger:
......@@ -83,7 +83,7 @@ void fnNeighb(uint16_t unusedParamButMandatory) {
convertLongIntegerRegisterToReal(REGISTER_X, (real_t *)&x, &ctxtReal39);
real34ToReal(REGISTER_REAL16_DATA(REGISTER_Y), &y);
longIntegerInit(lgIntY);
intToLongInteger(real39CompareEqual(&y, &x) ? 0 : (real39CompareGreaterThan(&y, &x) ? 1 : -1), lgIntY);
intToLongInteger(realCompareEqual(&y, &x) ? 0 : (realCompareGreaterThan(&y, &x) ? 1 : -1), lgIntY);
break;
default: {}
......@@ -124,7 +124,7 @@ void fnNeighb(uint16_t unusedParamButMandatory) {
convertLongIntegerRegisterToReal(REGISTER_X, (real_t *)&x, &ctxtReal39);
real16ToReal(REGISTER_REAL16_DATA(REGISTER_Y), &y);
longIntegerInit(lgIntY);
intToLongInteger(real39CompareEqual(&y, &x) ? 0 : (real39CompareGreaterThan(&y, &x) ? 1 : -1), lgIntY);
intToLongInteger(realCompareEqual(&y, &x) ? 0 : (realCompareGreaterThan(&y, &x) ? 1 : -1), lgIntY);
longIntegerAdd(lgIntX, lgIntY, lgIntX);
convertLongIntegerToShortIntegerRegister(lgIntX, getRegisterShortIntegerBase(REGISTER_X), REGISTER_X);
break;
......@@ -140,7 +140,7 @@ void fnNeighb(uint16_t unusedParamButMandatory) {
convertLongIntegerRegisterToReal(REGISTER_X, (real_t *)&x, &ctxtReal39);
real34ToReal(REGISTER_REAL16_DATA(REGISTER_Y), &y);
longIntegerInit(lgIntY);
intToLongInteger(real39CompareEqual(&y, &x) ? 0 : (real39CompareGreaterThan(&y, &x) ? 1 : -1), lgIntY);
intToLongInteger(realCompareEqual(&y, &x) ? 0 : (realCompareGreaterThan(&y, &x) ? 1 : -1), lgIntY);
longIntegerAdd(lgIntX, lgIntY, lgIntX);
convertLongIntegerToShortIntegerRegister(lgIntX, getRegisterShortIntegerBase(REGISTER_X), REGISTER_X);
break;
......
......@@ -113,7 +113,7 @@ void fnReToCx(uint16_t unusedParamButMandatory) {
if(xIsAReal) {
convertAngle39FromTo(&theta, currentAngularMode, AM_RADIAN);
}
if(real39CompareLessThan(&magnitude, const_0)) {
if(realCompareLessThan(&magnitude, const_0)) {
realSetPositiveSign(&magnitude);
realAdd(&theta, const_pi, &theta, &ctxtReal39);
realDivideRemainder(&theta, const_2pi, &theta, &ctxtReal39);
......@@ -146,7 +146,7 @@ void fnReToCx(uint16_t unusedParamButMandatory) {
if(xIsAReal) {
convertAngle39FromTo(&theta, currentAngularMode, AM_RADIAN);
}
if(real39CompareLessThan(&magnitude, const_0)) {
if(realCompareLessThan(&magnitude, const_0)) {
realSetPositiveSign(&magnitude);
realAdd(&theta, const_pi, &theta, &ctxtReal39);
realDivideRemainder(&theta, const_2pi, &theta, &ctxtReal39);
......
......@@ -79,21 +79,21 @@ void WP34S_Cvt2RadSinCosTan(const real_t *an, uint32_t angularMode, real_t *sin3
}
// sin(180+x) = -sin(x), cos(180+x) = -cos(x)
if(real39CompareGreaterEqual(&angle, angle180 + angularMode)) { // angle >= 180°
if(realCompareGreaterEqual(&angle, angle180 + angularMode)) { // angle >= 180°
realSubtract(&angle, angle180 + angularMode, &angle, &ctxtReal39); // angle - 180° --> angle
sinNeg = !sinNeg;
cosNeg = !cosNeg;
}