Files | |
| file | eg_lpnum.c |
| file | eg_lpnum.dbl.h |
| file | eg_lpnum.ex.c |
| file | eg_lpnum.float128.h |
| file | eg_lpnum.fp20.h |
| Here we provide an implementation of the common EGlpNum interface using EGlib fixed point numbers, on the case where we store 20 bits for fractional values, 11 bits for integers part and one sign bit. See eg_fp.h for more details. | |
| file | eg_lpnum.h |
| file | eg_lpnum.int.h |
| file | eg_lpnum.ldbl.h |
| file | eg_lpnum.llint.h |
| file | eg_lpnum.mpf.h |
| file | eg_lpnum.mpq.h |
| file | eg_lpnum.mpz.h |
Data Structures | |
| union | f64dbl_t |
| union to conver C doubles to float64 types as provided by SoftFloat. This is needed because the default conversion does not apply. More... | |
| #define | EGLPNUM_ISFP 1 |
| #define | EGLPNUM_MAXCONVORDER 2U |
| #define | EGlpNum_t double |
| #define | EGlpNumAddInnProdTo(a, b, c) dbl_EGlpNumAddInnProdTo(a,b,c) |
| #define | EGlpNumAddTo(a, b) dbl_EGlpNumAddTo(a,b) |
| #define | EGlpNumAddUiTo(a, b) dbl_EGlpNumAddUiTo(a,b) |
| #define | EGlpNumAllocArray(size) dbl_EGlpNumAllocArray(size) |
| #define | EGlpNumCeil(a, b) dbl_EGlpNumCeil(a,b) |
| #define | EGlpNumClearVar(a) dbl_EGlpNumClearVar(a) |
| #define | EGlpNumCopy(dest, orig) dbl_EGlpNumCopy(dest,orig) |
| #define | EGlpNumCopyAbs(dest, orig) dbl_EGlpNumCopyAbs(dest,orig) |
| #define | EGlpNumCopyArray(dest, orig, size) dbl_EGlpNumCopyArray(dest,orig,size) |
| #define | EGlpNumCopyDiff(dest, a, b) dbl_EGlpNumCopyDiff(dest,a,b) |
| #define | EGlpNumCopyDiffRatio(a, b, c, d) dbl_EGlpNumCopyDiffRatio(a,b,c,d) |
| #define | EGlpNumCopyFrac(dest, op1, op2) dbl_EGlpNumCopyFrac(dest,op1,op2) |
| #define | EGlpNumCopyNeg(dest, orig) dbl_EGlpNumCopyNeg(dest,orig) |
| #define | EGlpNumCopySqrOver(dest, orig, den) dbl_EGlpNumCopySqrOver(dest,orig,den) |
| #define | EGlpNumCopySum(dest, a, b) dbl_EGlpNumCopySum(dest,a,b) |
| #define | EGlpNumDivTo(a, b) dbl_EGlpNumDivTo(a,b) |
| #define | EGlpNumDivUiTo(a, b) dbl_EGlpNumDivUiTo(a,b) |
| #define | EGlpNumFloor(a, b) dbl_EGlpNumFloor(a,b) |
| #define | EGlpNumFreeArray(ea) dbl_EGlpNumFreeArray(ea) |
| #define | EGlpNumGetStr(a) dbl_EGlpNumGetStr(a) |
| #define | EGlpNumInitVar(a) dbl_EGlpNumInitVar(a) |
| #define | EGlpNumInv(a) dbl_EGlpNumInv(a) |
| #define | EGlpNumIsDiffLess(a, b, c) dbl_EGlpNumIsDiffLess(a,b,c) |
| #define | EGlpNumIsEqqual(a, b) dbl_EGlpNumIsEqqual(a,b) |
| #define | EGlpNumIsEqual(a, b, error) dbl_EGlpNumIsEqual(a,b,error) |
| #define | EGlpNumIsGreaDbl(a, b) dbl_EGlpNumIsGreaDbl(a,b) |
| #define | EGlpNumIsLeq(a, b) dbl_EGlpNumIsLeq(a,b) |
| #define | EGlpNumIsLess(a, b) dbl_EGlpNumIsLess(a,b) |
| #define | EGlpNumIsLessDbl(a, b) dbl_EGlpNumIsLessDbl(a,b) |
| #define | EGlpNumIsNeq(a, b, error) dbl_EGlpNumIsNeq(a,b,error) |
| #define | EGlpNumIsNeqq(a, b) dbl_EGlpNumIsNeqq(a,b) |
| #define | EGlpNumIsNeqqZero(a) dbl_EGlpNumIsNeqqZero(a) |
| #define | EGlpNumIsNeqZero(a, error) dbl_EGlpNumIsNeqZero(a,error) |
| #define | EGlpNumIsSumLess(a, b, c) dbl_EGlpNumIsSumLess(a,b,c) |
| #define | EGlpNumMultTo(a, b) dbl_EGlpNumMultTo(a,b) |
| #define | EGlpNumMultUiTo(a, b) dbl_EGlpNumMultUiTo(a,b) |
| #define | EGlpNumOne(a) dbl_EGlpNumOne(a) |
| #define | EGlpNumReadStr(a, str) dbl_EGlpNumReadStr(a,str) |
| #define | EGlpNumReallocArray(lptr, size) dbl_EGlpNumReallocArray(lptr,size) |
| #define | EGlpNumSet(var, dbl) dbl_EGlpNumSet(var,dbl) |
| #define | EGlpNumSetToMaxAbs(dest, orig) dbl_EGlpNumSetToMaxAbs(dest,orig) |
| #define | EGlpNumSetToMinAbs(dest, orig) dbl_EGlpNumSetToMinAbs(dest,orig) |
| #define | EGlpNumSign(a) dbl_EGlpNumSign(a) |
| #define | EGlpNumSubInnProdTo(a, b, c) dbl_EGlpNumSubInnProdTo(a,b,c) |
| #define | EGlpNumSubTo(a, b) dbl_EGlpNumSubTo(a,b) |
| #define | EGlpNumSubUiTo(a, b) dbl_EGlpNumSubUiTo(a,b) |
| #define | EGlpNumToLf(a) dbl_EGlpNumToLf(a) |
| #define | EGlpNumZero(a) dbl_EGlpNumZero(a) |
| #define | epsLpNum dbl_epsLpNum |
| #define | oneLpNum dbl_oneLpNum |
| #define | zeroLpNum dbl_zeroLpNum |
| float128 | __lpnum_float128__ |
| mpf_t | __lpnum_mpf__ |
| mpq_t | __lpnum_mpq__ |
| mpz_t | __lpnum_mpz__ |
| float128 | __oneLpNum_float128__ = {.high = 0x3fff000000000000LL,.low = 0 } |
| mpf_t | __oneLpNum_mpf__ |
| mpq_t | __oneLpNum_mpq__ |
| mpz_t | __oneLpNum_mpz__ |
| float128 | __zeroLpNum_float128__ = { 0, 0 } |
| mpf_t | __zeroLpNum_mpf__ |
| mpq_t | __zeroLpNum_mpq__ |
| mpz_t | __zeroLpNum_mpz__ |
| type-dependant constants and helper numbers | |
| float128 | float128_eps = {.high = 0x3f8f000000000000,.low = 0 } |
| This is the smallest difference (with the current precision) that can be distinguished betwen 1.0 and it's clossest representable number, in some sense it is the absolute minimum epsilon for comparisons. | |
Defines | |
| #define | __EGlpNumAllocArray(type, size) |
| Allocate an array of a given type and store (four bytes before the actual array) the size of the allocated array. | |
| #define | __EGlpNumArraySize(array) |
| Given an array allocated with __EGlpNumAllocArray, return the size of the given array, if the array is null, return zero. | |
| #define | __EGlpNumFreeArray(array) |
| , given an array allocated by __EGlpNumAllocArray, free the allocated memory. | |
| #define | dbl_EGlpNumAddInnProdTo(a, b, c) ((a) += (b)*(c)) |
| Add to a given number the product of two numbers. | |
| #define | dbl_EGlpNumAddTo(a, b) ((a) += (b)) |
| Add to a given number the value of the second number. | |
| #define | dbl_EGlpNumAddUiTo(a, b) ((a) += (b)) |
| Add to a given number the value of the second number. | |
| #define | dbl_EGlpNumAllocArray(size) __EGlpNumAllocArray(double,size) |
| Allocate and initialize (if needed) 'size' elements of type double and return it, if no more memory, exit(1). | |
| #define | dbl_EGlpNumCeil(a, b) ((a) = ceil(b)) |
| Stores in the first number the ceil value of the second number, i.e. EGlpNumCeil(a,b) <==> a= ceil(b). | |
| #define | dbl_EGlpNumClearVar(a) |
| free the internal memory of a given variable | |
| #define | dbl_EGlpNumCopy(dest, orig) ((dest) = (orig)) |
| copy the value of the second number to the first. | |
| #define | dbl_EGlpNumCopyAbs(dest, orig) ((dest) = fabs(orig)) |
| copy the value of the absolute value of the second parameter to the first parameter. | |
| #define | dbl_EGlpNumCopyArray(dest, orig, size) memcpy(dest,orig,sizeof(double)*(size)) |
| copy the first 'size' values in the second array to the first array. | |
| #define | dbl_EGlpNumCopyDiff(dest, a, b) ((dest) = (a) - (b)) |
| copy the value of the second number to the first. | |
| #define | dbl_EGlpNumCopyDiffRatio(dest, a, b, den) ((dest) = ((a) - (b)) / (den)) |
| copy the value of the second number to the first. | |
| #define | dbl_EGlpNumCopyFrac(dest, op1, op2) ((dest) = (op1)/(op2)) |
| Set des = op1/op2. | |
| #define | dbl_EGlpNumCopyNeg(dest, orig) ((dest) = -(orig)) |
| copy minus the value of the second parameter to the first parameter. | |
| #define | dbl_EGlpNumCopySqrOver(dest, orig, den) ((dest) = (orig)*(orig)/(den)) |
| copy the square of the second argument, divided by the third argument into the first argument. | |
| #define | dbl_EGlpNumCopySum(dest, a, b) ((dest) = (a) + (b)) |
| copy the value of the sum of the second and third parameter | |
| #define | dbl_EGlpNumDivTo(a, b) ((a) /= (b)) |
| Divide a given number by the value of the second number. | |
| #define | dbl_EGlpNumDivUiTo(a, b) ((a) /= (b)) |
| Divide a given number by the value of the second number. | |
| #define | dbl_EGlpNumFloor(a, b) ((a) = floor(b)) |
| Stores in the first number the floor value of the second number, i.e. EGlpNumFloor(a,b) <==> a= floor(b). | |
| #define | dbl_EGlpNumFreeArray(ea) __EGlpNumFreeArray(ea) |
| given an array of type double, free it, if the pointer is NULL nothing happen. | |
| #define | dbl_EGlpNumGetStr(a) |
| given a double, write it to a string (to be allocated internally), and return it. | |
| #define | dbl_EGlpNumInitVar(a) dbl_EGlpNumZero(a) |
| initialize the internal memory of a given variable | |
| #define | dbl_EGlpNumInv(a) ((a) = 1.0/(a)) |
| store the (multiplicative) inverse of a number to itself, i.e. implement a = 1/a. | |
| #define | dbl_EGlpNumIsDiffLess(a, b, c) ((a) - (b) < (c)) |
| test if the diference of the first two numbers is less thatn the third number. | |
| #define | dbl_EGlpNumIsEqqual(a, b) ((a) == (b)) |
| Compare if two numbers are equal within a maximum error. | |
| #define | dbl_EGlpNumIsEqual(a, b, error) (fabs((a)-(b)) <= (error)) |
| Compare if two numbers are equal within a maximum error. | |
| #define | dbl_EGlpNumIsGreaDbl(a, b) ((a) > (b)) |
| test if the first number is bigger to the second number | |
| #define | dbl_EGlpNumIsLeq(a, b) ((a) <= (b)) |
| test if the first number is bigger to the second number | |
| #define | dbl_EGlpNumIsLess(a, b) (a < b) |
| test if the first number is bigger to the second number | |
| #define | dbl_EGlpNumIsLessDbl(a, b) ((a) < (b)) |
| test if the first number is bigger to the second number | |
| #define | dbl_EGlpNumIsNeq(a, b, error) (((a)-(b) > (error)) || ((b)-(a) > (error))) |
| #define | dbl_EGlpNumIsNeqq(a, b) ((a) != (b)) |
| #define | dbl_EGlpNumIsNeqqZero(a) ((a) != 0.0) |
| #define | dbl_EGlpNumIsNeqZero(a, error) (((a) > (error)) || (-(a) > (error))) |
| #define | dbl_EGlpNumIsSumLess(a, b, c) ((a) + (b) < (c)) |
| test if the sum of the first two numbers is less thatn the third number. | |
| #define | dbl_EGlpNumMultTo(a, b) ((a) *= (b)) |
| Multiply a given number by the value of the second number. | |
| #define | dbl_EGlpNumMultUiTo(a, b) ((a) *= (b)) |
| Multiply a given number by the value of the second number. | |
| #define | dbl_EGlpNumOne(a) ((a) = 1.0) |
| Reset the value of the pointed number to one. | |
| #define | dbl_EGlpNumReadStr(a, str) |
| Read from a string a number and store it in the given double,. | |
| #define | dbl_EGlpNumReallocArray(lptr, lsize) |
| Reallocate and initialize (if needed) 'size' elements of type EGlpNum_t and return it, if no more memory, exit(1). | |
| #define | dbl_EGlpNumSet(var, dbl) ((var) = (dbl)) |
| set the given number pointer, set its value to the given double. | |
| #define | dbl_EGlpNumSetToMaxAbs(dest, orig) |
| change the fist number to the maximum between itself and the absolute value of the second. | |
| #define | dbl_EGlpNumSetToMinAbs(dest, orig) |
| #define | dbl_EGlpNumSign(a) ((a) = -(a)) |
| Change the sign of the number. | |
| #define | dbl_EGlpNumSubInnProdTo(a, b, c) ((a) -= (b)*(c)) |
| Sub to a given number the product of two numbers. | |
| #define | dbl_EGlpNumSubTo(a, b) ((a) -= (b)) |
| Substract to a given number the value of the second number. | |
| #define | dbl_EGlpNumSubUiTo(a, b) ((a) -= (b)) |
| Substract to a given number the value of the second number. | |
| #define | dbl_EGlpNumToLf(a) (a) |
| return the closest double value of the given pointer number. | |
| #define | dbl_EGlpNumZero(a) ((a) = 0.0) |
| Reset the value of the pointed number to zero. | |
| #define | dbl_epsLpNum DBL_EPSILON |
| #define | dbl_oneLpNum 1.0 |
| #define | dbl_zeroLpNum 0.0 |
| #define | EGabs(var) |
| a general macro to return the absolute value of the given variable | |
| #define | EGLPNUM_DEBUGL 100 |
| Debugging verbosity messages deped on the value of DEBUG (defined in eg_configure.h) and on the value of EGLPNUM_DEBUGL macro defined here. | |
| #define | EGLPNUM_MINEPS 3e-10 |
| This constant define the of the acuracy required while converting doubles to rationals, a good number is 1e-5. More exactly, we stop the continued fraction method whenever the next e_i-[e_i] computed is less than EGLPNUM_MINEPS. Note that this value can't be smaller than 1/ULONG_MAX, otherwise we will have problems in the confertion step. | |
| #define | EGLPNUM_TYPE DBL_TYPE |
| default type for EGLPNUM_TYPE | |
| #define | EGmax(a, b) |
| given two variables (of the same type, and of some predefined type) return the maximum value among the two of them. | |
| #define | EGmin(a, b) |
| given two variables (of the same type, and of some predefined type) return the minimum value among the two of them. | |
| #define | EGswap(N1, N2, Ntmp) |
| Given tree numbers N1, N2 and Ntmp, swap values of N1 and N2 using Ntmp as a temporal number. The variables should be of some primitive type of C for this macro to work. | |
| #define | float128_EGlpNumAddInnProdTo(a, b, c) |
| Add to a given number the product of two numbers. | |
| #define | float128_EGlpNumAddTo(a, b) ((a) = float128_add(a,b)) |
| Add to a given number the value of the second number. | |
| #define | float128_EGlpNumAddUiTo(a, b) |
| Add to a given number the value of the second number. | |
| #define | float128_EGlpNumAllocArray(size) |
| Allocate and initialize (if needed) 'size' elements of type float128 and return it, if no more memory, exit(1). | |
| #define | float128_EGlpNumCeil(a, b) |
| Stores in the first number the ceil value of the second number, i.e. EGlpNumCeil(a,b) <==> a= ceil(b). | |
| #define | float128_EGlpNumClearVar(a) |
| free the internal memory of a given variable | |
| #define | float128_EGlpNumCopy(dest, orig) (dest=orig) |
| copy the value of the second number to the first. | |
| #define | float128_EGlpNumCopyAbs(dest, orig) |
| copy the value of the absolute value of the second parameter to the first parameter. | |
| #define | float128_EGlpNumCopyArray(dest, orig, size) memcpy(dest,orig,sizeof(float128)*(size)) |
| copy the first 'size' values in the second array to the first array. | |
| #define | float128_EGlpNumCopyDiff(dest, a, b) (dest = float128_sub(a,b)) |
| copy the value of the second number to the first. | |
| #define | float128_EGlpNumCopyDiffRatio(a, b, c, d) |
| copy the value of the second number to the first. | |
| #define | float128_EGlpNumCopyFrac(dest, op1, op2) ((dest) = float128_div(op1,op2)) |
| Set des = op1/op2. | |
| #define | float128_EGlpNumCopyNeg(dest, orig) |
| copy minus the value of the second parameter to the first parameter. | |
| #define | float128_EGlpNumCopySqrOver(dest, orig, den) |
| copy the square of the second argument, divided by the third argument into the first argument. | |
| #define | float128_EGlpNumCopySum(dest, a, b) (dest = float128_add(a,b)) |
| copy the value of the sum of the second and third parameter | |
| #define | float128_EGlpNumDivTo(a, b) ((a) = float128_div(a,b)) |
| Divide a given number by the value of the second number. | |
| #define | float128_EGlpNumDivUiTo(a, b) |
| Divide a given number by the value of the second number. | |
| #define | float128_EGlpNumEpow(num, exp) |
Given a double exp, compute and store it in the given float128 number. | |
| #define | float128_EGlpNumFloor(a, b) |
| Stores in the first number the floor value of the second number, i.e. EGlpNumFloor(a,b) <==> a= floor(b). | |
| #define | float128_EGlpNumFreeArray(ea) __EGlpNumFreeArray(ea) |
| given an array of type float128, free it, if the pointer is NULL nothing happen. | |
| #define | float128_EGlpNumGetStr(a) |
| given a float128, write it to a string (to be allocated internally), and return it. | |
| #define | float128_EGlpNumInitVar(a) (a = (float128){0,0}) |
| initialize the internal memory of a given variable | |
| #define | float128_EGlpNumInv(a) ((a) = float128_div(float128_oneLpNum,a)) |
| store the (multiplicative) inverse of a number to itself, i.e. implement a = 1/a. | |
| #define | float128_EGlpNumIsDiffLess(a, b, c) |
| test if the diference of the first two numbers is less thatn the third number. | |
| #define | float128_EGlpNumIsEqqual(a, b) (float128_eq(a,b)) |
| Compare if two numbers are equal within a maximum error. | |
| #define | float128_EGlpNumIsEqual(a, b, error) |
| Compare if two numbers are equal within a maximum error. | |
| #define | float128_EGlpNumIsGreaDbl(a, b) |
| test if the first number is bigger to the second number | |
| #define | float128_EGlpNumIsLeq(a, b) float128_le(a,b) |
| test if the first number is bigger to the second number | |
| #define | float128_EGlpNumIsLess(a, b) (float128_lt(a,b)) |
| test if the first number is bigger to the second number | |
| #define | float128_EGlpNumIsLessDbl(a, b) |
| test if the first number is bigger to the second number | |
| #define | float128_EGlpNumIsNeq(a, b, error) |
| #define | float128_EGlpNumIsNeqq(a, b) (!float128_eq(a,b)) |
| #define | float128_EGlpNumIsNeqqZero(a) (!float128_eq(a,float128_zeroLpNum)) |
| #define | float128_EGlpNumIsNeqZero(a, error) |
| #define | float128_EGlpNumIsSumLess(a, b, c) |
| test if the sum of the first two numbers is less thatn the third number. | |
| #define | float128_EGlpNumMultTo(a, b) ((a) = float128_mul(a,b)) |
| Multiply a given number by the value of the second number. | |
| #define | float128_EGlpNumMultUiTo(a, b) |
| Multiply a given number by the value of the second number. | |
| #define | float128_EGlpNumOne(a) ((a) = (float128){.high = 0x3fff000000000000LL, .low = 0}) |
| Reset the value of the pointed number to one. | |
| #define | float128_EGlpNumReadStr(a, str) |
| Read from a string a number and store it in the given float128,. | |
| #define | float128_EGlpNumReallocArray(lptr, lsize) |
| Reallocate and initialize (if needed) 'size' elements of type float128 and return it, if no more memory, exit(1). | |
| #define | float128_EGlpNumSet(var, edbl) |
| set the given number pointer, set its value to the given double. | |
| #define | float128_EGlpNumSetToMaxAbs(dest, orig) |
| change the fist number to the maximum between itself and the absolute value of the second. | |
| #define | float128_EGlpNumSetToMinAbs(dest, orig) |
| #define | float128_EGlpNumSign(a) ((a).high ^= 0x8000000000000000LL) |
| Change the sign of the number. | |
| #define | float128_EGlpNumSubInnProdTo(a, b, c) |
| Sub to a given number the product of two numbers. | |
| #define | float128_EGlpNumSubTo(a, b) ((a) = float128_sub(a,b)) |
| Substract to a given number the value of the second number. | |
| #define | float128_EGlpNumSubUiTo(a, b) |
| Substract to a given number the value of the second number. | |
| #define | float128_EGlpNumToLf(a) |
| return the closest double value of the given pointer number. | |
| #define | float128_EGlpNumZero(a) ((a) = (float128){0,0}) |
| Reset the value of the pointed number to zero. | |
| #define | float128_epsLpNum float128_eps |
| #define | float128_oneLpNum __oneLpNum_float128__ |
| #define | float128_zeroLpNum __zeroLpNum_float128__ |
| #define | fp20_EGlpNumAddInnProdTo(a, b, c) ((a) += ((EGfp20_t)((((long long)(b))*(c))/fp20_oneLpNum))) |
| Add to a given number the product of two numbers. | |
| #define | fp20_EGlpNumAddTo(a, b) ((a) += (b)) |
| Add to a given number the value of the second number. | |
| #define | fp20_EGlpNumAddUiTo(a, b) ((a) += (b)*fp20_oneLpNum) |
| Add to a given number the value of the second number. | |
| #define | fp20_EGlpNumAllocArray(size) __EGlpNumAllocArray(EGfp20_t,size) |
| Allocate and initialize (if needed) 'size' elements of type int and return it, if no more memory, exit(1). | |
| #define | fp20_EGlpNumCeil(a, b) |
| Stores in the first number the ceil value of the second number, i.e. EGlpNumCeil(a,b) <==> a= ceil(b). | |
| #define | fp20_EGlpNumClearVar(a) |
| free the internal memory of a given variable | |
| #define | fp20_EGlpNumCopy(dest, orig) ((dest) = (orig)) |
| copy the value of the second number to the first. | |
| #define | fp20_EGlpNumCopyAbs(dest, orig) ((dest) = EGabs(orig)) |
| copy the value of the absolute value of the second parameter to the first parameter. | |
| #define | fp20_EGlpNumCopyArray(dest, orig, size) memcpy(dest,orig,sizeof(EGfp20_t)*(size)) |
| copy the first 'size' values in the second array to the first array. | |
| #define | fp20_EGlpNumCopyDiff(dest, a, b) ((dest) = (a) - (b)) |
| copy the value of the second number to the first. | |
| #define | fp20_EGlpNumCopyDiffRatio(dest, a, b, den) ((dest) = (EGfp20_t)((((long long)((a) - (b)))*fp20_oneLpNum) / (den))) |
| copy the value of the second number to the first. | |
| #define | fp20_EGlpNumCopyFrac(dest, op1, op2) ((dest) = ((EGfp20_t)((((long long)(op1))*fp20_oneLpNum)/(op2)))) |
| Set des = op1/op2. | |
| #define | fp20_EGlpNumCopyNeg(dest, orig) ((dest) = -(orig)) |
| copy minus the value of the second parameter to the first parameter. | |
| #define | fp20_EGlpNumCopySqrOver(dest, orig, den) ((dest) = ((EGfp20_t)((((long long)(orig))*(orig))/(den)))) |
| copy the square of the second argument, divided by the third argument into the first argument. | |
| #define | fp20_EGlpNumCopySum(dest, a, b) ((dest) = (a) + (b)) |
| copy the value of the sum of the second and third parameter | |
| #define | fp20_EGlpNumDivTo(a, b) ((a) = ((EGfp20_t)((((long long)(a))*fp20_oneLpNum)/(b)))) |
| Divide a given number by the value of the second number. | |
| #define | fp20_EGlpNumDivUiTo(a, b) ((a) /= (b)) |
| Divide a given number by the value of the second number. | |
| #define | fp20_EGlpNumFloor(a, b) ((a) = (((b)/fp20_oneLpNum)*fp20_oneLpNum)) |
| Stores in the first number the floor value of the second number, i.e. EGlpNumFloor(a,b) <==> a= floor(b). | |
| #define | fp20_EGlpNumFreeArray(ea) __EGlpNumFreeArray(ea) |
| given an array of type int, free it, if the pointer is NULL nothing happen. | |
| #define | fp20_EGlpNumGetStr(a) |
| given a int, write it to a string (to be allocated internally), and return it. | |
| #define | fp20_EGlpNumInitVar(a) fp20_EGlpNumZero(a) |
| initialize the internal memory of a given variable | |
| #define | fp20_EGlpNumInv(a) |
| store the (multiplicative) inverse of a number to itself, i.e. implement a = 1/a. | |
| #define | fp20_EGlpNumIsDiffLess(a, b, c) ((a) - (b) < (c)) |
| test if the diference of the first two numbers is less thatn the third number. | |
| #define | fp20_EGlpNumIsEqqual(a, b) ((a) == (b)) |
| Compare if two numbers are equal within a maximum error. | |
| #define | fp20_EGlpNumIsEqual(a, b, error) (EGabs((a)-(b)) <= (error)) |
| Compare if two numbers are equal within a maximum error. | |
| #define | fp20_EGlpNumIsGreaDbl(a, b) ((a) > ((b)*fp20_oneLpNum)) |
| test if the first number is bigger to the second number | |
| #define | fp20_EGlpNumIsLeq(a, b) ((a) <= (b)) |
| test if the first number is bigger to the second number | |
| #define | fp20_EGlpNumIsLess(a, b) (a < b) |
| test if the first number is bigger to the second number | |
| #define | fp20_EGlpNumIsLessDbl(a, b) ((a) < ((b)*fp20_oneLpNum)) |
| test if the first number is bigger to the second number | |
| #define | fp20_EGlpNumIsNeq(a, b, error) (((a)-(b) > (error)) || ((b)-(a) > (error))) |
| #define | fp20_EGlpNumIsNeqq(a, b) ((a) != (b)) |
| #define | fp20_EGlpNumIsNeqqZero(a) ((a) != 0) |
| #define | fp20_EGlpNumIsNeqZero(a, error) (((a) > (error)) || (-(a) > (error))) |
| #define | fp20_EGlpNumIsSumLess(a, b, c) ((a) + (b) < (c)) |
| test if the sum of the first two numbers is less thatn the third number. | |
| #define | fp20_EGlpNumMultTo(a, b) ((a) = ((EGfp20_t)((((long long)(a))*(b))/fp20_oneLpNum))) |
| Multiply a given number by the value of the second number. | |
| #define | fp20_EGlpNumMultUiTo(a, b) ((a) *= (b)) |
| Multiply a given number by the value of the second number. | |
| #define | fp20_EGlpNumOne(a) ((a) = fp20_oneLpNum) |
| Reset the value of the pointed number to one. | |
| #define | fp20_EGlpNumReadStr(a, str) |
| Read from a string a number and store it in the given int,. | |
| #define | fp20_EGlpNumReallocArray(lptr, lsize) |
| Reallocate and initialize (if needed) 'size' elements of type EGlpNum_t and return it, if no more memory, exit(1). | |
| #define | fp20_EGlpNumSet(var, dbl_var) ((var) = (EGfp20_t)((dbl_var)*fp20_oneLpNum)) |
| set the given number pointer, set its value to the given int. | |
| #define | fp20_EGlpNumSetToMaxAbs(dest, orig) |
| change the fist number to the maximum between itself and the absolute value of the second. | |
| #define | fp20_EGlpNumSetToMinAbs(dest, orig) |
| #define | fp20_EGlpNumSign(a) ((a) = -(a)) |
| Change the sign of the number. | |
| #define | fp20_EGlpNumSubInnProdTo(a, b, c) ((a) -= ((EGfp20_t)((((long long)(b))*(c))/fp20_oneLpNum))) |
| Sub to a given number the product of two numbers. | |
| #define | fp20_EGlpNumSubTo(a, b) ((a) -= (b)) |
| Substract to a given number the value of the second number. | |
| #define | fp20_EGlpNumSubUiTo(a, b) ((a) -= (b)*fp20_oneLpNum) |
| Substract to a given number the value of the second number. | |
| #define | fp20_EGlpNumToLf(a) (((double)(a))/fp20_oneLpNum) |
| return the closest int value of the given pointer number. | |
| #define | fp20_EGlpNumZero(a) ((a) = 0) |
| Reset the value of the pointed number to zero. | |
| #define | fp20_epsLpNum 1 |
| #define | fp20_oneLpNum 0x100000 |
| #define | fp20_zeroLpNum 0 |
| #define | int_EGlpNumAddInnProdTo(a, b, c) ((a) += (b)*(c)) |
| Add to a given number the product of two numbers. | |
| #define | int_EGlpNumAddTo(a, b) ((a) += (b)) |
| Add to a given number the value of the second number. | |
| #define | int_EGlpNumAddUiTo(a, b) ((a) += (b)) |
| Add to a given number the value of the second number. | |
| #define | int_EGlpNumAllocArray(size) __EGlpNumAllocArray(int,size) |
| Allocate and initialize (if needed) 'size' elements of type int and return it, if no more memory, exit(1). | |
| #define | int_EGlpNumCeil(a, b) int_EGlpNumSet(a,b) |
| Stores in the first number the ceil value of the second number, i.e. EGlpNumCeil(a,b) <==> a= ceil(b). | |
| #define | int_EGlpNumClearVar(a) |
| free the internal memory of a given variable | |
| #define | int_EGlpNumCopy(dest, orig) ((dest) = (orig)) |
| copy the value of the second number to the first. | |
| #define | int_EGlpNumCopyAbs(dest, orig) ((dest) = EGabs(orig)) |
| copy the value of the absolute value of the second parameter to the first parameter. | |
| #define | int_EGlpNumCopyArray(dest, orig, size) memcpy(dest,orig,sizeof(int)*(size)) |
| copy the first 'size' values in the second array to the first array. | |
| #define | int_EGlpNumCopyDiff(dest, a, b) ((dest) = (a) - (b)) |
| copy the value of the second number to the first. | |
| #define | int_EGlpNumCopyDiffRatio(dest, a, b, den) ((dest) = ((a) - (b)) / (den)) |
| copy the value of the second number to the first. | |
| #define | int_EGlpNumCopyFrac(dest, op1, op2) ((dest) = (op1)/(op2)) |
| Set des = op1/op2. | |
| #define | int_EGlpNumCopyNeg(dest, orig) ((dest) = -(orig)) |
| copy minus the value of the second parameter to the first parameter. | |
| #define | int_EGlpNumCopySqrOver(dest, orig, den) ((dest) = (orig)*(orig)/(den)) |
| copy the square of the second argument, divided by the third argument into the first argument. | |
| #define | int_EGlpNumCopySum(dest, a, b) ((dest) = (a) + (b)) |
| copy the value of the sum of the second and third parameter | |
| #define | int_EGlpNumDivTo(a, b) ((a) /= (b)) |
| Divide a given number by the value of the second number. | |
| #define | int_EGlpNumDivUiTo(a, b) ((a) /= (b)) |
| Divide a given number by the value of the second number. | |
| #define | int_EGlpNumFloor(a, b) int_EGlpNumSet(a,b) |
| Stores in the first number the floor value of the second number, i.e. EGlpNumFloor(a,b) <==> a= floor(b). | |
| #define | int_EGlpNumFreeArray(ea) __EGlpNumFreeArray(ea) |
| given an array of type int, free it, if the pointer is NULL nothing happen. | |
| #define | int_EGlpNumGetStr(a) |
| given a int, write it to a string (to be allocated internally), and return it. | |
| #define | int_EGlpNumInitVar(a) int_EGlpNumZero(a) |
| initialize the internal memory of a given variable | |
| #define | int_EGlpNumInv(a) ((a) = 1/(a)) |
| store the (multiplicative) inverse of a number to itself, i.e. implement a = 1/a. | |
| #define | int_EGlpNumIsDiffLess(a, b, c) ((a) - (b) < (c)) |
| test if the diference of the first two numbers is less thatn the third number. | |
| #define | int_EGlpNumIsEqqual(a, b) ((a) == (b)) |
| Compare if two numbers are equal within a maximum error. | |
| #define | int_EGlpNumIsEqual(a, b, error) (EGabs((a)-(b)) <= (error)) |
| Compare if two numbers are equal within a maximum error. | |
| #define | int_EGlpNumIsGreaDbl(a, b) ((a) > (b)) |
| test if the first number is bigger to the second number | |
| #define | int_EGlpNumIsLeq(a, b) ((a) <= (b)) |
| test if the first number is bigger to the second number | |
| #define | int_EGlpNumIsLess(a, b) (a < b) |
| test if the first number is bigger to the second number | |
| #define | int_EGlpNumIsLessDbl(a, b) ((a) < (b)) |
| test if the first number is bigger to the second number | |
| #define | int_EGlpNumIsNeq(a, b, error) (((a)-(b) > (error)) || ((b)-(a) > (error))) |
| #define | int_EGlpNumIsNeqq(a, b) ((a) != (b)) |
| #define | int_EGlpNumIsNeqqZero(a) ((a) != 0) |
| #define | int_EGlpNumIsNeqZero(a, error) (((a) > (error)) || (-(a) > (error))) |
| #define | int_EGlpNumIsSumLess(a, b, c) ((a) + (b) < (c)) |
| test if the sum of the first two numbers is less thatn the third number. | |
| #define | int_EGlpNumMultTo(a, b) ((a) *= (b)) |
| Multiply a given number by the value of the second number. | |
| #define | int_EGlpNumMultUiTo(a, b) ((a) *= (b)) |
| Multiply a given number by the value of the second number. | |
| #define | int_EGlpNumOne(a) ((a) = 1) |
| Reset the value of the pointed number to one. | |
| #define | int_EGlpNumReadStr(a, str) |
| Read from a string a number and store it in the given int,. | |
| #define | int_EGlpNumReallocArray(lptr, lsize) |
| Reallocate and initialize (if needed) 'size' elements of type EGlpNum_t and return it, if no more memory, exit(1). | |
| #define | int_EGlpNumSet(var, dbl_var) ((var) = (dbl_var)) |
| set the given number pointer, set its value to the given int. | |
| #define | int_EGlpNumSetToMaxAbs(dest, orig) |
| change the fist number to the maximum between itself and the absolute value of the second. | |
| #define | int_EGlpNumSetToMinAbs(dest, orig) |
| #define | int_EGlpNumSign(a) ((a) = -(a)) |
| Change the sign of the number. | |
| #define | int_EGlpNumSubInnProdTo(a, b, c) ((a) -= (b)*(c)) |
| Sub to a given number the product of two numbers. | |
| #define | int_EGlpNumSubTo(a, b) ((a) -= (b)) |
| Substract to a given number the value of the second number. | |
| #define | int_EGlpNumSubUiTo(a, b) ((a) -= (b)) |
| Substract to a given number the value of the second number. | |
| #define | int_EGlpNumToLf(a) (a) |
| return the closest int value of the given pointer number. | |
| #define | int_EGlpNumZero(a) ((a) = 0) |
| Reset the value of the pointed number to zero. | |
| #define | int_epsLpNum 0 |
| #define | int_oneLpNum 1 |
| #define | int_zeroLpNum 0 |
| #define | ldbl_EGlpNumAddInnProdTo(a, b, c) ((a) += (b)*(c)) |
| Add to a given number the product of two numbers. | |
| #define | ldbl_EGlpNumAddTo(a, b) ((a) += (b)) |
| Add to a given number the value of the second number. | |
| #define | ldbl_EGlpNumAddUiTo(a, b) ((a) += (b)) |
| Add to a given number the value of the second number. | |
| #define | ldbl_EGlpNumAllocArray(size) __EGlpNumAllocArray(long double,size) |
| Allocate and initialize (if needed) 'size' elements of type long double and return it, if no more memory, exit(1). | |
| #define | ldbl_EGlpNumCeil(a, b) ((a) = ceill(b)) |
| Stores in the first number the ceil value of the second number, i.e. EGlpNumCeil(a,b) <==> a= ceil(b). | |
| #define | ldbl_EGlpNumClearVar(a) |
| free the internal memory of a given variable | |
| #define | ldbl_EGlpNumCopy(dest, orig) ((dest) = (orig)) |
| copy the value of the second number to the first. | |
| #define | ldbl_EGlpNumCopyAbs(dest, orig) ((dest) = fabsl(orig)) |
| copy the value of the absolute value of the second parameter to the first parameter. | |
| #define | ldbl_EGlpNumCopyArray(dest, orig, size) memcpy(dest,orig,sizeof(long double)*(size)) |
| copy the first 'size' values in the second array to the first array. | |
| #define | ldbl_EGlpNumCopyDiff(dest, a, b) ((dest) = (a) - (b)) |
| copy the value of the second number to the first. | |
| #define | ldbl_EGlpNumCopyDiffRatio(dest, a, b, den) ((dest) = ((a) - (b)) / (den)) |
| copy the value of the second number to the first. | |
| #define | ldbl_EGlpNumCopyFrac(dest, op1, op2) ((dest) = (op1)/(op2)) |
| Set des = op1/op2. | |
| #define | ldbl_EGlpNumCopyNeg(dest, orig) ((dest) = -(orig)) |
| copy minus the value of the second parameter to the first parameter. | |
| #define | ldbl_EGlpNumCopySqrOver(dest, orig, den) ((dest) = (orig)*(orig)/(den)) |
| copy the square of the second argument, divided by the third argument into the first argument. | |
| #define | ldbl_EGlpNumCopySum(dest, a, b) ((dest) = (a) + (b)) |
| copy the value of the sum of the second and third parameter | |
| #define | ldbl_EGlpNumDivTo(a, b) ((a) /= (b)) |
| Divide a given number by the value of the second number. | |
| #define | ldbl_EGlpNumDivUiTo(a, b) ((a) /= (b)) |
| Divide a given number by the value of the second number. | |
| #define | ldbl_EGlpNumFloor(a, b) ((a) = floorl(b)) |
| Stores in the first number the floor value of the second number, i.e. EGlpNumFloor(a,b) <==> a= floor(b). | |
| #define | ldbl_EGlpNumFreeArray(ea) __EGlpNumFreeArray(ea) |
| given an array of type long double, free it, if the pointer is NULL nothing happen. | |
| #define | ldbl_EGlpNumGetStr(a) |
| given a long double, write it to a string (to be allocated internally), and return it. | |
| #define | ldbl_EGlpNumInitVar(a) ldbl_EGlpNumZero(a) |
| initialize the internal memory of a given variable | |
| #define | ldbl_EGlpNumInv(a) ((a) = 1.0L/(a)) |
| store the (multiplicative) inverse of a number to itself, i.e. implement a = 1/a. | |
| #define | ldbl_EGlpNumIsDiffLess(a, b, c) ((a) - (b) < (c)) |
| test if the diference of the first two numbers is less thatn the third number. | |
| #define | ldbl_EGlpNumIsEqqual(a, b) ((a) == (b)) |
| Compare if two numbers are equal within a maximum error. | |
| #define | ldbl_EGlpNumIsEqual(a, b, error) (fabsl((a)-(b)) <= (error)) |
| Compare if two numbers are equal within a maximum error. | |
| #define | ldbl_EGlpNumIsGreaDbl(a, b) ((a) > (b)) |
| test if the first number is bigger to the second number | |
| #define | ldbl_EGlpNumIsLeq(a, b) ((a) <= (b)) |
| test if the first number is bigger to the second number | |
| #define | ldbl_EGlpNumIsLess(a, b) (a < b) |
| test if the first number is bigger to the second number | |
| #define | ldbl_EGlpNumIsLessDbl(a, b) ((a) < (b)) |
| test if the first number is bigger to the second number | |
| #define | ldbl_EGlpNumIsNeq(a, b, error) (((a)-(b) > (error)) || ((b)-(a) > (error))) |
| #define | ldbl_EGlpNumIsNeqq(a, b) ((a) != (b)) |
| #define | ldbl_EGlpNumIsNeqqZero(a) ((a) != 0.0) |
| #define | ldbl_EGlpNumIsNeqZero(a, error) (((a) > (error)) || (-(a) > (error))) |
| #define | ldbl_EGlpNumIsSumLess(a, b, c) ((a) + (b) < (c)) |
| test if the sum of the first two numbers is less thatn the third number. | |
| #define | ldbl_EGlpNumMultTo(a, b) ((a) *= (b)) |
| Multiply a given number by the value of the second number. | |
| #define | ldbl_EGlpNumMultUiTo(a, b) ((a) *= (b)) |
| Multiply a given number by the value of the second number. | |
| #define | ldbl_EGlpNumOne(a) ((a) = 1.0L) |
| Reset the value of the pointed number to one. | |
| #define | ldbl_EGlpNumReadStr(a, str) |
| Read from a string a number and store it in the given long double,. | |
| #define | ldbl_EGlpNumReallocArray(lptr, lsize) |
| Reallocate and initialize (if needed) 'size' elements of type EGlpNum_t and return it, if no more memory, exit(1). | |
| #define | ldbl_EGlpNumSet(var, ldbl) ((var) = (ldbl)) |
| set the given number pointer, set its value to the given long double. | |
| #define | ldbl_EGlpNumSetToMaxAbs(dest, orig) |
| change the fist number to the maximum between itself and the absolute value of the second. | |
| #define | ldbl_EGlpNumSetToMinAbs(dest, orig) |
| #define | ldbl_EGlpNumSign(a) ((a) = -(a)) |
| Change the sign of the number. | |
| #define | ldbl_EGlpNumSubInnProdTo(a, b, c) ((a) -= (b)*(c)) |
| Sub to a given number the product of two numbers. | |
| #define | ldbl_EGlpNumSubTo(a, b) ((a) -= (b)) |
| Substract to a given number the value of the second number. | |
| #define | ldbl_EGlpNumSubUiTo(a, b) ((a) -= (b)) |
| Substract to a given number the value of the second number. | |
| #define | ldbl_EGlpNumToLf(a) ((double)(a)) |
| return the closest long double value of the given pointer number. | |
| #define | ldbl_EGlpNumZero(a) ((a) = 0.0L) |
| Reset the value of the pointed number to zero. | |
| #define | ldbl_epsLpNum LDBL_EPSILON |
| #define | ldbl_oneLpNum 1.0L |
| #define | ldbl_zeroLpNum 0.0L |
| #define | llint_EGlpNumAddInnProdTo(a, b, c) ((a) += (b)*(c)) |
| Add to a given number the product of two numbers. | |
| #define | llint_EGlpNumAddTo(a, b) ((a) += (b)) |
| Add to a given number the value of the second number. | |
| #define | llint_EGlpNumAddUiTo(a, b) ((a) += (b)) |
| Add to a given number the value of the second number. | |
| #define | llint_EGlpNumAllocArray(size) __EGlpNumAllocArray(long long int,size) |
| Allocate and initialize (if needed) 'size' elements of type long long int and return it, if no more memory, exit(1). | |
| #define | llint_EGlpNumCeil(a, b) llint_EGlpNumSet(a,b) |
| Stores in the first number the ceil value of the second number, i.e. EGlpNumCeil(a,b) <==> a= ceil(b). | |
| #define | llint_EGlpNumClearVar(a) |
| free the internal memory of a given variable | |
| #define | llint_EGlpNumCopy(dest, orig) ((dest) = (orig)) |
| copy the value of the second number to the first. | |
| #define | llint_EGlpNumCopyAbs(dest, orig) ((dest) = EGabs(orig)) |
| copy the value of the absolute value of the second parameter to the first parameter. | |
| #define | llint_EGlpNumCopyArray(dest, orig, size) memcpy(dest,orig,sizeof(long long int)*(size)) |
| copy the first 'size' values in the second array to the first array. | |
| #define | llint_EGlpNumCopyDiff(dest, a, b) ((dest) = (a) - (b)) |
| copy the value of the second number to the first. | |
| #define | llint_EGlpNumCopyDiffRatio(dest, a, b, den) ((dest) = ((a) - (b)) / (den)) |
| copy the value of the second number to the first. | |
| #define | llint_EGlpNumCopyFrac(dest, op1, op2) ((dest) = (op1)/(op2)) |
| Set des = op1/op2. | |
| #define | llint_EGlpNumCopyNeg(dest, orig) ((dest) = -(orig)) |
| copy minus the value of the second parameter to the first parameter. | |
| #define | llint_EGlpNumCopySqrOver(dest, orig, den) ((dest) = (orig)*(orig)/(den)) |
| copy the square of the second argument, divided by the third argument into the first argument. | |
| #define | llint_EGlpNumCopySum(dest, a, b) ((dest) = (a) + (b)) |
| copy the value of the sum of the second and third parameter | |
| #define | llint_EGlpNumDivTo(a, b) ((a) /= (b)) |
| Divide a given number by the value of the second number. | |
| #define | llint_EGlpNumDivUiTo(a, b) ((a) /= (b)) |
| Divide a given number by the value of the second number. | |
| #define | llint_EGlpNumFloor(a, b) llint_EGlpNumSet(a,b) |
| Stores in the first number the floor value of the second number, i.e. EGlpNumFloor(a,b) <==> a= floor(b). | |
| #define | llint_EGlpNumFreeArray(ea) __EGlpNumFreeArray(ea) |
| given an array of type long long int, free it, if the pointer is NULL nothing happen. | |
| #define | llint_EGlpNumGetStr(a) |
| given a long long int, write it to a string (to be allocated internally), and return it. | |
| #define | llint_EGlpNumInitVar(a) llint_EGlpNumZero(a) |
| initialize the internal memory of a given variable | |
| #define | llint_EGlpNumInv(a) ((a) = 1/(a)) |
| store the (multiplicative) inverse of a number to itself, i.e. implement a = 1/a. | |
| #define | llint_EGlpNumIsDiffLess(a, b, c) ((a) - (b) < (c)) |
| test if the diference of the first two numbers is less thatn the third number. | |
| #define | llint_EGlpNumIsEqqual(a, b) ((a) == (b)) |
| Compare if two numbers are equal within a maximum error. | |
| #define | llint_EGlpNumIsEqual(a, b, error) (EGabs((a)-(b)) <= (error)) |
| Compare if two numbers are equal within a maximum error. | |
| #define | llint_EGlpNumIsGreaDbl(a, b) ((a) > (b)) |
| test if the first number is bigger to the second number | |
| #define | llint_EGlpNumIsLeq(a, b) ((a) <= (b)) |
| test if the first number is bigger to the second number | |
| #define | llint_EGlpNumIsLess(a, b) (a < b) |
| test if the first number is bigger to the second number | |
| #define | llint_EGlpNumIsLessDbl(a, b) ((a) < (b)) |
| test if the first number is bigger to the second number | |
| #define | llint_EGlpNumIsNeq(a, b, error) (((a)-(b) > (error)) || ((b)-(a) > (error))) |
| #define | llint_EGlpNumIsNeqq(a, b) ((a) != (b)) |
| #define | llint_EGlpNumIsNeqqZero(a) ((a) != 0) |
| #define | llint_EGlpNumIsNeqZero(a, error) (((a) > (error)) || (-(a) > (error))) |
| #define | llint_EGlpNumIsSumLess(a, b, c) ((a) + (b) < (c)) |
| test if the sum of the first two numbers is less thatn the third number. | |
| #define | llint_EGlpNumMultTo(a, b) ((a) *= (b)) |
| Multiply a given number by the value of the second number. | |
| #define | llint_EGlpNumMultUiTo(a, b) ((a) *= (b)) |
| Multiply a given number by the value of the second number. | |
| #define | llint_EGlpNumOne(a) ((a) = 1) |
| Reset the value of the pointed number to one. | |
| #define | llint_EGlpNumReadStr(a, str) |
| Read from a string a number and store it in the given long long int,. | |
| #define | llint_EGlpNumReallocArray(lptr, lsize) |
| Reallocate and initialize (if needed) 'size' elements of type EGlpNum_t and return it, if no more memory, exit(1). | |
| #define | llint_EGlpNumSet(var, dbl_var) ((var) = (dbl_var)) |
| set the given number pointer, set its value to the given long long int. | |
| #define | llint_EGlpNumSetToMaxAbs(dest, orig) |
| change the fist number to the maximum between itself and the absolute value of the second. | |
| #define | llint_EGlpNumSetToMinAbs(dest, orig) |
| #define | llint_EGlpNumSign(a) ((a) = -(a)) |
| Change the sign of the number. | |
| #define | llint_EGlpNumSubInnProdTo(a, b, c) ((a) -= (b)*(c)) |
| Sub to a given number the product of two numbers. | |
| #define | llint_EGlpNumSubTo(a, b) ((a) -= (b)) |
| Substract to a given number the value of the second number. | |
| #define | llint_EGlpNumSubUiTo(a, b) ((a) -= (b)) |
| Substract to a given number the value of the second number. | |
| #define | llint_EGlpNumToLf(a) (a) |
| return the closest long long int value of the given pointer number. | |
| #define | llint_EGlpNumZero(a) ((a) = 0) |
| Reset the value of the pointed number to zero. | |
| #define | llint_epsLpNum 0LL |
| #define | llint_oneLpNum 1LL |
| #define | llint_zeroLpNum 0LL |
| #define | mpf_EGlpNumAddInnProdTo(a, b, c) |
| Add to a given number the product of two numbers. | |
| #define | mpf_EGlpNumAddTo(a, b) mpf_add(a,a,b) |
| Add to a given number the value of the second number. | |
| #define | mpf_EGlpNumAddUiTo(a, b) mpf_add_ui(a,a,((unsigned)(b))) |
| Add to a given number the value of the second number. | |
| #define | mpf_EGlpNumAllocArray(size) |
| Allocate and initialize (if needed) 'size' elements of type mpf_t and return it, if no more memory, exit(1). | |
| #define | mpf_EGlpNumCeil(a, b) mpf_ceil(a,b) |
| Stores in the first number the ceil value of the second number, i.e. EGlpNumCeil(a,b) <==> a= ceil(b). | |
| #define | mpf_EGlpNumClearVar(a) mpf_clear(a) |
| free the internal memory of a given variable | |
| #define | mpf_EGlpNumCopy(dest, orig) mpf_set(dest,orig) |
| copy the value of the second number to the first. | |
| #define | mpf_EGlpNumCopyAbs(dest, orig) mpf_abs(dest,orig) |
| copy the value of the absolute value of the second parameter to the first parameter. | |
| #define | mpf_EGlpNumCopyArray(dest, orig, size) |
| copy the first 'size' values in the second array to the first array. | |
| #define | mpf_EGlpNumCopyDiff(dest, a, b) mpf_sub(dest,a,b) |
| copy the value of the second number to the first. | |
| #define | mpf_EGlpNumCopyDiffRatio(a, b, c, d) |
| copy the value of the second number to the first. | |
| #define | mpf_EGlpNumCopyFrac(dest, op1, op2) mpf_div(dest,op1,op2) |
| Set des = op1/op2. | |
| #define | mpf_EGlpNumCopyNeg(dest, orig) mpf_neg(dest,orig) |
| copy minus the value of the second parameter to the first parameter. | |
| #define | mpf_EGlpNumCopySqrOver(dest, orig, den) |
| copy the square of the second argument, divided by the third argument into the first argument. | |
| #define | mpf_EGlpNumCopySum(dest, a, b) mpf_add(dest,a,b) |
| copy the value of the sum of the second and third parameter | |
| #define | mpf_EGlpNumDivTo(a, b) mpf_div(a,a,b) |
| Divide a given number by the value of the second number. | |
| #define | mpf_EGlpNumDivUiTo(a, b) mpf_div_ui(a,a,((unsigned)(b))) |
| Divide a given number by the value of the second number. | |
| #define | mpf_EGlpNumEpow(num, exp) |
Given a double exp, compute and store it in the given mpf_t number. | |
| #define | mpf_EGlpNumFloor(a, b) mpf_floor(a,b) |
| Stores in the first number the floor value of the second number, i.e. EGlpNumFloor(a,b) <==> a= floor(b). | |
| #define | mpf_EGlpNumFreeArray(ea) |
| given an array of type mpf_t, free it, if the pointer is NULL nothing happen. | |
| #define | mpf_EGlpNumGetStr(a) |
| given a mpf_t, write it to a string (to be allocated internally), and return it. | |
| #define | mpf_EGlpNumInitVar(a) mpf_init(a) |
| initialize the internal memory of a given variable | |
| #define | mpf_EGlpNumInv(a) mpf_ui_div(a,1U,a) |
| store the (multiplicative) inverse of a number to itself, i.e. implement a = 1/a. | |
| #define | mpf_EGlpNumIsDiffLess(a, b, c) |
| test if the diference of the first two numbers is less thatn the third number. | |
| #define | mpf_EGlpNumIsEqqual(a, b) (mpf_cmp(a,b) == 0) |
| Compare if two numbers are equal within a maximum error. | |
| #define | mpf_EGlpNumIsEqual(a, b, error) |
| Compare if two numbers are equal within a maximum error. | |
| #define | mpf_EGlpNumIsGreaDbl(a, b) (mpf_cmp_d(a,((double)(b))) > 0) |
| test if the first number is bigger to the second number | |
| #define | mpf_EGlpNumIsLeq(a, b) (mpf_cmp(a,b) <= 0) |
| test if the first number is bigger to the second number | |
| #define | mpf_EGlpNumIsLess(a, b) (mpf_cmp(a,b) < 0) |
| test if the first number is bigger to the second number | |
| #define | mpf_EGlpNumIsLessDbl(a, b) (mpf_cmp_d(a,((double)(b))) < 0) |
| test if the first number is bigger to the second number | |
| #define | mpf_EGlpNumIsNeq(a, b, error) |
| #define | mpf_EGlpNumIsNeqq(a, b) (mpf_cmp(a,b)!=0) |
| #define | mpf_EGlpNumIsNeqqZero(a) (mpf_cmp(a,mpf_zeroLpNum)!=0) |
| #define | mpf_EGlpNumIsNeqZero(a, error) |
| #define | mpf_EGlpNumIsSumLess(a, b, c) |
| test if the sum of the first two numbers is less thatn the third number. | |
| #define | mpf_EGlpNumMultTo(a, b) mpf_mul(a,a,b) |
| Multiply a given number by the value of the second number. | |
| #define | mpf_EGlpNumMultUiTo(a, b) mpf_mul_ui(a,a,((unsigned)(b))) |
| Multiply a given number by the value of the second number. | |
| #define | mpf_EGlpNumOne(a) mpf_set_ui(a,1U) |
| Reset the value of the pointed number to one. | |
| #define | mpf_EGlpNumReadStr(a, str) |
| Read from a string a number and store it in the given mpf_t,. | |
| #define | mpf_EGlpNumReallocArray(lptr, lsize) |
| Reallocate and initialize (if needed) 'size' elements of type mpf_t and return it, if no more memory, exit(1). | |
| #define | mpf_EGlpNumSet(var, dbl) mpf_set_d(var,(double)(dbl)) |
| set the given number pointer, set its value to the given double. | |
| #define | mpf_EGlpNumSetToMaxAbs(dest, orig) |
| change the fist number to the maximum between itself and the absolute value of the second. | |
| #define | mpf_EGlpNumSetToMinAbs(dest, orig) |
| #define | mpf_EGlpNumSign(a) mpf_neg(a,a) |
| Change the sign of the number. | |
| #define | mpf_EGlpNumSubInnProdTo(a, b, c) |
| Sub to a given number the product of two numbers. | |
| #define | mpf_EGlpNumSubTo(a, b) mpf_sub(a,a,b) |
| Substract to a given number the value of the second number. | |
| #define | mpf_EGlpNumSubUiTo(a, b) mpf_sub_ui(a,a,((unsigned)(b))) |
| Substract to a given number the value of the second number. | |
| #define | mpf_EGlpNumToLf(a) mpf_get_d(a) |
| return the closest double value of the given pointer number. | |
| #define | mpf_EGlpNumZero(a) mpf_set_ui(a,0U) |
| Reset the value of the pointed number to zero. | |
| #define | mpf_epsLpNum mpf_eps |
| #define | mpf_oneLpNum __oneLpNum_mpf__ |
| #define | mpf_zeroLpNum __zeroLpNum_mpf__ |
| #define | mpq_EGlpNumAddInnProdTo(a, b, c) |
| Add to a given number the product of two numbers. | |
| #define | mpq_EGlpNumAddTo(a, b) mpq_add(a,a,b) |
| Add to a given number the value of the second number. | |
| #define | mpq_EGlpNumAddUiTo(a, b) mpz_addmul_ui(mpq_numref(a),mpq_denref(a),b) |
| Add to a given number the value of the second number. | |
| #define | mpq_EGlpNumAllocArray(size) |
| Allocate and initialize (if needed) 'size' elements of type mpq_t and return it, if no more memory, exit(1). | |
| #define | mpq_EGlpNumCeil(a, b) |
| Stores in the first number the ceil value of the second number, i.e. EGlpNumCeil(a,b) <==> a= ceil(b). | |
| #define | mpq_EGlpNumClearVar(a) mpq_clear(a) |
| free the internal memory of a given variable | |
| #define | mpq_EGlpNumCopy(dest, orig) mpq_set(dest,orig) |
| copy the value of the second number to the first. | |
| #define | mpq_EGlpNumCopyAbs(dest, orig) mpq_abs(dest,orig) |
| copy the value of the absolute value of the second parameter to the first parameter. | |
| #define | mpq_EGlpNumCopyArray(dest, orig, size) |
| copy the first 'size' values in the second array to the first array. | |
| #define | mpq_EGlpNumCopyDiff(dest, a, b) mpq_sub(dest,a,b) |
| copy the value of the second number to the first. | |
| #define | mpq_EGlpNumCopyDiffRatio(a, b, c, d) |
| copy the value of the second number to the first. | |
| #define | mpq_EGlpNumCopyFrac(dest, op1, op2) mpq_div(dest,op1,op2) |
| Set des = op1/op2. | |
| #define | mpq_EGlpNumCopyNeg(dest, orig) mpq_neg(dest,orig) |
| copy minus the value of the second parameter to the first parameter. | |
| #define | mpq_EGlpNumCopySqrOver(dest, orig, den) |
| copy the square of the second argument, divided by the third argument into the first argument. | |
| #define | mpq_EGlpNumCopySum(dest, a, b) mpq_add(dest,a,b) |
| copy the value of the sum of the second and third parameter | |
| #define | mpq_EGlpNumDivTo(a, b) mpq_div(a,a,b) |
| Divide a given number by the value of the second number. | |
| #define | mpq_EGlpNumDivUiTo(a, b) ({mpz_mul_ui(mpq_denref(a),mpq_denref(a),b);mpq_canonicalize(a);0;}) |
| Divide a given number by the value of the second number. | |
| #define | mpq_EGlpNumFloor(a, b) |
| Stores in the first number the floor value of the second number, i.e. EGlpNumFloor(a,b) <==> a= floor(b). | |
| #define | mpq_EGlpNumFreeArray(ea) |
| given an array of type mpq_t, free it, if the pointer is NULL nothing happen. | |
| #define | mpq_EGlpNumGetStr(a) mpq_get_str(0,10,a) |
| given a mpq_t, write it to a string (to be allocated internally), and return it. | |
| #define | mpq_EGlpNumInitVar(a) mpq_init(a) |
| initialize the internal memory of a given variable | |
| #define | mpq_EGlpNumInv(a) mpq_inv(a,a) |
| store the (multiplicative) inverse of a number to itself, i.e. implement a = 1/a. | |
| #define | mpq_EGlpNumIsDiffLess(a, b, c) |
| test if the diference of the first two numbers is less thatn the third number. | |
| #define | mpq_EGlpNumIsEqqual(a, b) (mpq_equal(a,b)) |
| Compare if two numbers are equal within a maximum error. | |
| #define | mpq_EGlpNumIsEqual(a, b, error) (mpq_equal(a,b)) |
| Compare if two numbers are equal within a maximum error. | |
| #define | mpq_EGlpNumIsGreaDbl(a, b) (mpq_get_d(a) > b) |
| test if the first number is bigger to the second number | |
| #define | mpq_EGlpNumIsLeq(a, b) (mpq_cmp(a,b) <= 0) |
| test if the first number is bigger to the second number | |
| #define | mpq_EGlpNumIsLess(a, b) (mpq_cmp(a,b) < 0) |
| test if the first number is bigger to the second number | |
| #define | mpq_EGlpNumIsLessDbl(a, b) (mpq_get_d(a) < b) |
| test if the first number is bigger to the second number | |
| #define | mpq_EGlpNumIsNeq(a, b, error) (!(mpq_equal(a,b))) |
| #define | mpq_EGlpNumIsNeqq(a, b) (!(mpq_equal(a,b))) |
| #define | mpq_EGlpNumIsNeqqZero(a) (!(mpq_equal(a,mpq_zeroLpNum))) |
| #define | mpq_EGlpNumIsNeqZero(a, error) (!(mpq_equal(a,mpq_zeroLpNum))) |
| #define | mpq_EGlpNumIsSumLess(a, b, c) |
| test if the sum of the first two numbers is less thatn the third number. | |
| #define | mpq_EGlpNumMultTo(a, b) mpq_mul(a,a,b) |
| Multiply a given number by the value of the second number. | |
| #define | mpq_EGlpNumMultUiTo(a, b) ({mpz_mul_ui(mpq_numref(a),mpq_numref(a),b);mpq_canonicalize(a);0;}) |
| Multiply a given number by the value of the second number. | |
| #define | mpq_EGlpNumOne(a) mpq_set_ui(a,1U,1U) |
| Reset the value of the pointed number to one. | |
| #define | mpq_EGlpNumReadStr(a, str) mpq_EGlpNumReadStrXc(a,str) |
| Read from a string a number and store it in the given mpq_t, return the number of chars readed from the input string. | |
| #define | mpq_EGlpNumReallocArray(lptr, lsize) |
| Reallocate and initialize (if needed) 'size' elements of type mpq_t and return it, if no more memory, exit(1). | |
| #define | mpq_EGlpNumSetToMaxAbs(dest, orig) |
| change the fist number to the maximum between itself and the absolute value of the second. | |
| #define | mpq_EGlpNumSetToMinAbs(dest, orig) |
| #define | mpq_EGlpNumSign(a) mpq_neg(a,a) |
| Change the sign of the number. | |
| #define | mpq_EGlpNumSubInnProdTo(a, b, c) |
| Sub to a given number the product of two numbers. | |
| #define | mpq_EGlpNumSubTo(a, b) mpq_sub(a,a,b) |
| Substract to a given number the value of the second number. | |
| #define | mpq_EGlpNumSubUiTo(a, b) mpz_submul_ui(mpq_numref(a),mpq_denref(a),b) |
| Substract to a given number the value of the second number. | |
| #define | mpq_EGlpNumToLf(a) mpq_get_d(a) |
| return the closest double value of the given pointer number. | |
| #define | mpq_EGlpNumZero(a) mpq_set_ui(a,0U,1U) |
| Reset the value of the pointed number to zero. | |
| #define | mpq_epsLpNum __zeroLpNum_mpq__ |
| #define | mpq_oneLpNum __oneLpNum_mpq__ |
| #define | mpq_zeroLpNum __zeroLpNum_mpq__ |
| #define | mpz_EGlpNumAddInnProdTo(a, b, c) |
| Add to a given number the product of two numbers. | |
| #define | mpz_EGlpNumAddTo(a, b) mpz_add(a,a,b) |
| Add to a given number the value of the second number. | |
| #define | mpz_EGlpNumAddUiTo(a, b) (mpz_addmul_ui(mpz_numref(a),mpz_denref(a),b),mpz_canonicalize(a)) |
| Add to a given number the value of the second number. | |
| #define | mpz_EGlpNumAllocArray(size) |
| Allocate and initialize (if needed) 'size' elements of type mpz_t and return it, if no more memory, exit(1). | |
| #define | mpz_EGlpNumCeil(a, b) |
| Stores in the first number the ceil value of the second number, i.e. EGlpNumCeil(a,b) <==> a= ceil(b). | |
| #define | mpz_EGlpNumClearVar(a) mpz_clear(a) |
| free the internal memory of a given variable | |
| #define | mpz_EGlpNumCopy(dest, orig) mpz_set(dest,orig) |
| copy the value of the second number to the first. | |
| #define | mpz_EGlpNumCopyAbs(dest, orig) mpz_abs(dest,orig) |
| copy the value of the absolute value of the second parameter to the first parameter. | |
| #define | mpz_EGlpNumCopyArray(dest, orig, size) |
| copy the first 'size' values in the second array to the first array. | |
| #define | mpz_EGlpNumCopyDiff(dest, a, b) mpz_sub(dest,a,b) |
| copy the value of the second number to the first. | |
| #define | mpz_EGlpNumCopyDiffRatio(a, b, c, d) |
| copy the value of the second number to the first. | |
| #define | mpz_EGlpNumCopyFrac(dest, op1, op2) mpz_div(dest,op1,op2) |
| Set des = op1/op2. | |
| #define | mpz_EGlpNumCopyNeg(dest, orig) mpz_neg(dest,orig) |
| copy minus the value of the second parameter to the first parameter. | |
| #define | mpz_EGlpNumCopySqrOver(dest, orig, den) |
| copy the square of the second argument, divided by the third argument into the first argument. | |
| #define | mpz_EGlpNumCopySum(dest, a, b) mpz_add(dest,a,b) |
| copy the value of the sum of the second and third parameter | |
| #define | mpz_EGlpNumDivTo(a, b) mpz_div(a,a,b) |
| Divide a given number by the value of the second number. | |
| #define | mpz_EGlpNumDivUiTo(a, b) (mpz_mul_ui(mpz_denref(a),mpz_denref(a),b),mpz_canonicalize(a)) |
| Divide a given number by the value of the second number. | |
| #define | mpz_EGlpNumFloor(a, b) |
| Stores in the first number the floor value of the second number, i.e. EGlpNumFloor(a,b) <==> a= floor(b). | |
| #define | mpz_EGlpNumFreeArray(ea) |
| given an array of type mpz_t, free it, if the pointer is NULL nothing happen. | |
| #define | mpz_EGlpNumGetStr(a) |
| given a mpz_t, write it to a string (to be allocated internally), and return it. | |
| #define | mpz_EGlpNumInitVar(a) mpz_init(a) |
| initialize the internal memory of a given variable | |
| #define | mpz_EGlpNumInv(a) mpz_inv(a,a) |
| store the (multiplicative) inverse of a number to itself, i.e. implement a = 1/a. | |
| #define | mpz_EGlpNumIsDiffLess(a, b, c) |
| test if the diference of the first two numbers is less thatn the third number. | |
| #define | mpz_EGlpNumIsEqqual(a, b) (mpz_equal(a,b)) |
| Compare if two numbers are equal within a maximum error. | |
| #define | mpz_EGlpNumIsEqual(a, b, error) (mpz_equal(a,b)) |
| Compare if two numbers are equal within a maximum error. | |
| #define | mpz_EGlpNumIsGreaDbl(a, b) (mpz_get_d(a) > b) |
| test if the first number is bigger to the second number | |
| #define | mpz_EGlpNumIsLeq(a, b) (mpz_cmp(a,b) <= 0) |
| test if the first number is bigger to the second number | |
| #define | mpz_EGlpNumIsLess(a, b) (mpz_cmp(a,b) < 0) |
| test if the first number is bigger to the second number | |
| #define | mpz_EGlpNumIsLessDbl(a, b) (mpz_get_d(a) < b) |
| test if the first number is bigger to the second number | |
| #define | mpz_EGlpNumIsNeq(a, b, error) (!(mpz_equal(a,b))) |
| #define | mpz_EGlpNumIsNeqq(a, b) (!(mpz_equal(a,b))) |
| #define | mpz_EGlpNumIsNeqqZero(a) (!(mpz_equal(a,mpz_zeroLpNum))) |
| #define | mpz_EGlpNumIsNeqZero(a, error) (!(mpz_equal(a,mpz_zeroLpNum))) |
| #define | mpz_EGlpNumIsSumLess(a, b, c) |
| test if the sum of the first two numbers is less thatn the third number. | |
| #define | mpz_EGlpNumMultTo(a, b) mpz_mul(a,a,b) |
| Multiply a given number by the value of the second number. | |
| #define | mpz_EGlpNumMultUiTo(a, b) (mpz_mul_ui(mpz_numref(a),mpz_numref(a),b),mpz_canonicalize(a)) |
| Multiply a given number by the value of the second number. | |
| #define | mpz_EGlpNumOne(a) mpz_set_ui(a,1U,1U) |
| Reset the value of the pointed number to one. | |
| #define | mpz_EGlpNumReallocArray(lptr, lsize) |
| Reallocate and initialize (if needed) 'size' elements of type mpz_t and return it, if no more memory, exit(1). | |
| #define | mpz_EGlpNumSet (var, dbl) mpz_set_d(var,dbl) |
| set the given number pointer, set its value to the given double. | |
| #define | mpz_EGlpNumSetToMaxAbs(dest, orig) |
| change the fist number to the maximum between itself and the absolute value of the second. | |
| #define | mpz_EGlpNumSetToMinAbs(dest, orig) |
| #define | mpz_EGlpNumSign(a) mpz_neg(a,a) |
| Change the sign of the number. | |
| #define | mpz_EGlpNumSubInnProdTo(a, b, c) |
| Sub to a given number the product of two numbers. | |
| #define | mpz_EGlpNumSubTo(a, b) mpz_sub(a,a,b) |
| Substract to a given number the value of the second number. | |
| #define | mpz_EGlpNumSubUiTo(a, b) (mpz_submul_ui(mpz_numref(a),mpz_denref(a),b),mpz_canonicalize(a)) |
| Substract to a given number the value of the second number. | |
| #define | mpz_EGlpNumToLf(a) mpz_get_d(a) |
| return the closest double value of the given pointer number. | |
| #define | mpz_EGlpNumZero(a) mpz_set_ui(a,0U,1U) |
| Reset the value of the pointed number to zero. | |
| #define | mpz_epsLpNum __zeroLpNum_mpz__ |
| #define | mpz_oneLpNum __oneLpNum_mpz__ |
| #define | mpz_zeroLpNum __zeroLpNum_mpz__ |
Functions | |
| void | EGlpNumExit (void) |
| This function must be called at the end of the program to free all internal data used in the EGlpNum_t structures, once this function is called any operation on EGlpNum_t types may fail. | |
| void | EGlpNumSetPrecision (const unsigned prec) |
| Change the default precision for mpf_t numbers. | |
| void | EGlpNumStart (void) |
| This function must be called once to initialize internal data needed for all supported EGlpNum_t type. | |
| int | main (int argc, char **argv) |
| Tester program for EGlpNum_t structure and functions. | |
| int | mpq_EGlpNumReadStrXc (mpq_t var, char const *str) |
| This function read a number in float form and store it in an mpq_t variable, returning how many chars read to create the number, the twist is that it do an 'exact' transformation, in the sense that 0.33333333 will be stored as 33333333/100000000. | |
| void | mpq_EGlpNumSet (mpq_t var, const double dbl) |
| set the given number pointer, set its value to the given double. | |
| void | mpq_EGlpNumSet_mpf (mpq_t var, mpf_t flt) |
| set the given rational number , to the value to the value of the given mpf_t, this conversion is done using the continuous fraction method. | |
| int | mpz_EGlpNumReadStr (mpz_t a, const char *const str) |
| Read from a string a number and store it in the given mpz_t, return the number of chars readed from the input string. | |
Variables | |
| float128 | __lpnum_float128__ |
| mpf_t | __lpnum_mpf__ |
| mpq_t | __lpnum_mpq__ |
| mpz_t | __lpnum_mpz__ |
| float128 | __oneLpNum_float128__ |
| mpf_t | __oneLpNum_mpf__ |
| mpq_t | __oneLpNum_mpq__ |
| mpz_t | __oneLpNum_mpz__ |
| float128 | __zeroLpNum_float128__ |
| mpf_t | __zeroLpNum_mpf__ |
| mpq_t | __zeroLpNum_mpq__ |
| mpz_t | __zeroLpNum_mpz__ |
| type-dependant constants and helper numbers | |
| unsigned | EGLPNUM_PRECISION |
| Set the default number of __BITS__ used in the precision of the float point numbers (mpf_t), a normal double use up to 56-64 bits., the default precision is set to 128. | |
| unsigned | EGLPNUM_PRECISION = 128 |
| Set the default number of __BITS__ used in the precision of the float point numbers (mpf_t), a normal double use up to 56-64 bits., the default precision is set to 128. | |
| float128 | float128_eps |
| This is the smallest difference (with the current precision) that can be distinguished betwen 1.0 and it's clossest representable number, in some sense it is the absolute minimum epsilon for comparisons. | |
| mpf_t | mpf_eps |
| This is the smallest difference (with the current precision) that can be distinguished betwen 1.0 and it's clossest representable number, in some sense it is the absolute minimum epsilon for comparisons. | |
| mpf_t | mpf_eps |
| This is the smallest difference (with the current precision) that can be distinguished betwen 1.0 and it's clossest representable number, in some sense it is the absolute minimum epsilon for comparisons. | |
|
|
Value: ({\
unsigned __sz = (size);\
unsigned *__utmp = __sz ? (unsigned*) EGmalloc (sizeof(type) * __sz + sizeof(unsigned)) : 0;\
if(__sz) __utmp[0] = __sz;\
(type*)(__sz ? (__utmp+1):0);})
Definition at line 237 of file eg_lpnum.h. |
|
|
Value: ({\
unsigned *__utmp = (unsigned*)(array);\
if(__utmp) __utmp--;\
__utmp ? __utmp[0]:0;})
Definition at line 248 of file eg_lpnum.h. |
|
|
Value: ({\
unsigned *__utmp = (unsigned*)(array);\
if(__utmp) free (__utmp-1);\
(array) = 0;})
Definition at line 260 of file eg_lpnum.h. |
|
|
Add to a given number the product of two numbers.
Definition at line 336 of file eg_lpnum.dbl.h. |
|
|
Add to a given number the value of the second number.
Definition at line 366 of file eg_lpnum.dbl.h. |
|
|
Add to a given number the value of the second number.
Definition at line 356 of file eg_lpnum.dbl.h. |
|
|
Allocate and initialize (if needed) 'size' elements of type double and return it, if no more memory, exit(1).
Definition at line 78 of file eg_lpnum.dbl.h. |
|
|
Stores in the first number the ceil value of the second number, i.e. EGlpNumCeil(a,b) <==> a= ceil(b).
Definition at line 97 of file eg_lpnum.dbl.h. |
|
|
free the internal memory of a given variable
Definition at line 462 of file eg_lpnum.dbl.h. |
|
|
copy the value of the second number to the first.
Definition at line 240 of file eg_lpnum.dbl.h. |
|
|
copy the value of the absolute value of the second parameter to the first parameter.
Definition at line 276 of file eg_lpnum.dbl.h. |
|
|
copy the first 'size' values in the second array to the first array.
Definition at line 314 of file eg_lpnum.dbl.h. |
|
|
copy the value of the second number to the first.
Definition at line 222 of file eg_lpnum.dbl.h. |
|
|
copy the value of the second number to the first.
Definition at line 213 of file eg_lpnum.dbl.h. |
|
|
Set des = op1/op2.
Definition at line 298 of file eg_lpnum.dbl.h. |
|
|
copy minus the value of the second parameter to the first parameter.
Definition at line 288 of file eg_lpnum.dbl.h. |
|
|
copy the square of the second argument, divided by the third argument into the first argument.
Definition at line 264 of file eg_lpnum.dbl.h. |
|
|
copy the value of the sum of the second and third parameter
Definition at line 231 of file eg_lpnum.dbl.h. |
|
|
Divide a given number by the value of the second number.
Definition at line 399 of file eg_lpnum.dbl.h. |
|
|
Divide a given number by the value of the second number.
Definition at line 410 of file eg_lpnum.dbl.h. |
|
|
Stores in the first number the floor value of the second number, i.e. EGlpNumFloor(a,b) <==> a= floor(b).
Definition at line 102 of file eg_lpnum.dbl.h. |
|
|
given an array of type double, free it, if the pointer is NULL nothing happen.
Definition at line 55 of file eg_lpnum.dbl.h. |
|
|
Value: ({\
char *__str=0;\
unsigned int __i=snprintf(__str,0,"%.7lg",a);\
__str = EGsMalloc(char,__i+1);\
snprintf(__str,__i+1,"%.7lg",a);\
__str;})
Definition at line 45 of file eg_lpnum.dbl.h. |
|
|
initialize the internal memory of a given variable
Definition at line 458 of file eg_lpnum.dbl.h. |
|
|
store the (multiplicative) inverse of a number to itself, i.e. implement a = 1/a.
Definition at line 108 of file eg_lpnum.dbl.h. |
|
|
test if the diference of the first two numbers is less thatn the third number.
Definition at line 170 of file eg_lpnum.dbl.h. |
|
|
Compare if two numbers are equal within a maximum error.
Definition at line 118 of file eg_lpnum.dbl.h. |
|
|
Compare if two numbers are equal within a maximum error.
Definition at line 131 of file eg_lpnum.dbl.h. |
|
|
test if the first number is bigger to the second number
Definition at line 192 of file eg_lpnum.dbl.h. |
|
|
test if the first number is bigger to the second number
Definition at line 203 of file eg_lpnum.dbl.h. |
|
|
test if the first number is bigger to the second number
Definition at line 146 of file eg_lpnum.dbl.h. |
|
|
test if the first number is bigger to the second number
Definition at line 181 of file eg_lpnum.dbl.h. |
|
|
Definition at line 132 of file eg_lpnum.dbl.h. |
|
|
Definition at line 133 of file eg_lpnum.dbl.h. |
|
|
Definition at line 135 of file eg_lpnum.dbl.h. |
|
|
Definition at line 134 of file eg_lpnum.dbl.h. |
|
|
test if the sum of the first two numbers is less thatn the third number.
Definition at line 158 of file eg_lpnum.dbl.h. |
|
|
Multiply a given number by the value of the second number.
Definition at line 388 of file eg_lpnum.dbl.h. |
|
|
Multiply a given number by the value of the second number.
Definition at line 421 of file eg_lpnum.dbl.h. |
|
|
Reset the value of the pointed number to one.
Definition at line 437 of file eg_lpnum.dbl.h. |
|
|
Value: ({\
int __i =0;\
sscanf(str,"%lf%n",&(a),&__i);\
__i;})
Definition at line 37 of file eg_lpnum.dbl.h. |
|
|
Value: ({\
unsigned __csz = (lsize), *__usp = 0;\
unsigned __psz = __EGlpNumArraySize(*lptr);\
double** __ptr__ = (lptr);\
if (!__psz) *__ptr__ = dbl_EGlpNumAllocArray (__csz); \
else if (__psz < __csz) {\
__usp = (unsigned*)(*__ptr__);\
__usp--;\
__usp = EGrealloc(__usp, sizeof(double)*__csz+sizeof(unsigned));\
__usp[0] = __csz;\
*__ptr__ = (double*)(__usp+1);\
memset((*__ptr__)+__psz,0,sizeof(double)*(__csz-__psz));\
}\
*__ptr__;})
Definition at line 60 of file eg_lpnum.dbl.h. |
|
|
set the given number pointer, set its value to the given double.
Definition at line 92 of file eg_lpnum.dbl.h. |
|
|
Value: if((dest) < fabs(orig)) \
(dest) = fabs(orig)
Definition at line 250 of file eg_lpnum.dbl.h. |
|
|
Value: if((dest) > fabs(orig)) \
(dest) = fabs(orig)
Definition at line 252 of file eg_lpnum.dbl.h. |
|
|
Change the sign of the number.
Definition at line 445 of file eg_lpnum.dbl.h. |
|
|
Sub to a given number the product of two numbers.
Definition at line 325 of file eg_lpnum.dbl.h. |
|
|
Substract to a given number the value of the second number.
Definition at line 377 of file eg_lpnum.dbl.h. |
|
|
Substract to a given number the value of the second number.
Definition at line 346 of file eg_lpnum.dbl.h. |
|
|
return the closest double value of the given pointer number.
Definition at line 454 of file eg_lpnum.dbl.h. |
|
|
Reset the value of the pointed number to zero.
Definition at line 429 of file eg_lpnum.dbl.h. |
|
|
Definition at line 32 of file eg_lpnum.dbl.h. |
|
|
Definition at line 31 of file eg_lpnum.dbl.h. |
|
|
extern definitions of constaants for different set-ups Definition at line 30 of file eg_lpnum.dbl.h. |
|
|
Value: ({\
const typeof(var) __EGav = (var);\
(__EGav < 0) ? -__EGav : __EGav;})
Definition at line 200 of file eg_lpnum.h. |
|
|
Debugging verbosity messages deped on the value of DEBUG (defined in eg_configure.h) and on the value of EGLPNUM_DEBUGL macro defined here.
Definition at line 148 of file eg_lpnum.h. |
|
|
Definition at line 471 of file eg_lpnum.dbl.h. |
|
|
This are the definitions needed to use double numbers within our general framework Definition at line 469 of file eg_lpnum.dbl.h. |
|
|
This constant define the of the acuracy required while converting doubles to rationals, a good number is 1e-5. More exactly, we stop the continued fraction method whenever the next e_i-[e_i] computed is less than EGLPNUM_MINEPS. Note that this value can't be smaller than 1/ULONG_MAX, otherwise we will have problems in the confertion step.
Definition at line 157 of file eg_lpnum.h. |
|
|
Definition at line 475 of file eg_lpnum.dbl.h. |
|
|
default type for EGLPNUM_TYPE
Definition at line 278 of file eg_lpnum.h. |
|
|
Definition at line 478 of file eg_lpnum.dbl.h. |
|
|
Definition at line 476 of file eg_lpnum.dbl.h. |
|
|
Definition at line 477 of file eg_lpnum.dbl.h. |
|
|
Definition at line 479 of file eg_lpnum.dbl.h. |
|
|
Definition at line 480 of file eg_lpnum.dbl.h. |
|
|
Definition at line 481 of file eg_lpnum.dbl.h. |
|
|
Definition at line 482 of file eg_lpnum.dbl.h. |
|
|
Definition at line 488 of file eg_lpnum.dbl.h. |
|
|
Definition at line 483 of file eg_lpnum.dbl.h. |
|
|
Definition at line 484 of file eg_lpnum.dbl.h. |
|
|
Definition at line 485 of file eg_lpnum.dbl.h. |
|
|
Definition at line 490 of file eg_lpnum.dbl.h. |
|
|
Definition at line 489 of file eg_lpnum.dbl.h. |
|
|
Definition at line 487 of file eg_lpnum.dbl.h. |
|
|
Definition at line 486 of file eg_lpnum.dbl.h. |
|
|
Definition at line 491 of file eg_lpnum.dbl.h. |
|
|
Definition at line 492 of file eg_lpnum.dbl.h. |
|
|
Definition at line 493 of file eg_lpnum.dbl.h. |
|
|
Definition at line 494 of file eg_lpnum.dbl.h. |
|
|
Definition at line 495 of file eg_lpnum.dbl.h. |
|
|
Definition at line 496 of file eg_lpnum.dbl.h. |
|
|
Definition at line 497 of file eg_lpnum.dbl.h. |
|
|
Definition at line 498 of file eg_lpnum.dbl.h. |
|
|
Definition at line 499 of file eg_lpnum.dbl.h. |
|
|
Definition at line 500 of file eg_lpnum.dbl.h. |
|
|
Definition at line 501 of file eg_lpnum.dbl.h. |
|
|
Definition at line 504 of file eg_lpnum.dbl.h. |
|
|
Definition at line 503 of file eg_lpnum.dbl.h. |
|
|
Definition at line 502 of file eg_lpnum.dbl.h. |
|
|
Definition at line 505 of file eg_lpnum.dbl.h. |
|
|
Definition at line 506 of file eg_lpnum.dbl.h. |
|
|
Definition at line 508 of file eg_lpnum.dbl.h. |
|
|
Definition at line 507 of file eg_lpnum.dbl.h. |
|
|
Definition at line 509 of file eg_lpnum.dbl.h. |
|
|
Definition at line 510 of file eg_lpnum.dbl.h. |
|
|
Definition at line 511 of file eg_lpnum.dbl.h. |
|
|
Definition at line 512 of file eg_lpnum.dbl.h. |
|
|
Definition at line 513 of file eg_lpnum.dbl.h. |
|
|
Definition at line 514 of file eg_lpnum.dbl.h. |
|
|
Definition at line 515 of file eg_lpnum.dbl.h. |
|
|
Definition at line 516 of file eg_lpnum.dbl.h. |
|
|
Definition at line 517 of file eg_lpnum.dbl.h. |
|
|
Definition at line 518 of file eg_lpnum.dbl.h. |
|
|
Definition at line 521 of file eg_lpnum.dbl.h. |
|
|
Definition at line 519 of file eg_lpnum.dbl.h. |
|
|
Definition at line 520 of file eg_lpnum.dbl.h. |
|
|
Definition at line 522 of file eg_lpnum.dbl.h. |
|
|
Definition at line 523 of file eg_lpnum.dbl.h. |
|
|
Value: ({\
const typeof(a) __EGma = (a);\
const typeof(b) __EGmb = (b);\
(__EGma > __EGmb ? __EGma : __EGmb);})
Definition at line 181 of file eg_lpnum.h. |
|
|
Value: ({\
const typeof(a) __EGma = (a);\
const typeof(b) __EGmb = (b);\
(__EGma < __EGmb ? __EGma : __EGmb);})
Definition at line 189 of file eg_lpnum.h. |
|
|
Value: do{\ Ntmp = N1;\ N1 = N2;\ N2 = Ntmp;} while(0)
Definition at line 173 of file eg_lpnum.h. |
|
|
Definition at line 472 of file eg_lpnum.dbl.h. |
|
|
Value: ({\
__lpnum_float128__ = float128_mul ( b, c);\
(a) = float128_add (a, __lpnum_float128__);\
})
Definition at line 450 of file eg_lpnum.float128.h. |
|
|
Add to a given number the value of the second number.
Definition at line 487 of file eg_lpnum.float128.h. |
|
|
Value: ({\
__lpnum_float128__ = int64_to_float128((long long)(b));\
(a) = float128_add(a,__lpnum_float128__);})
Definition at line 475 of file eg_lpnum.float128.h. |
|
|
Value: ({\
register unsigned __i__ = (size);\
float128 *__res = __EGlpNumAllocArray(float128,__i__);\
while(__i__--) __res[__i__] = (float128){0,0};\
__res;})
Definition at line 138 of file eg_lpnum.float128.h. |
|
|
Value: do{\ (a) = float128_round_to_int(b);\ if(float128_lt(a,b)) (a) = float128_add((a),float128_oneLpNum);} while(0)
Definition at line 163 of file eg_lpnum.float128.h. |
|
|
free the internal memory of a given variable
Definition at line 589 of file eg_lpnum.float128.h. |
|
|
copy the value of the second number to the first.
Definition at line 339 of file eg_lpnum.float128.h. |
|
|
Value: ({\
(dest) = (orig);\
(dest).high &= 0x7fffffffffffffffLL;})
Definition at line 383 of file eg_lpnum.float128.h. |
|
|
copy the first 'size' values in the second array to the first array.
Definition at line 425 of file eg_lpnum.float128.h. |
|
|
copy the value of the second number to the first.
Definition at line 321 of file eg_lpnum.float128.h. |
|
|
Value: ({\
__lpnum_float128__ = float128_sub (b, c);\
a = float128_div (__lpnum_float128__, d);\
})
Definition at line 309 of file eg_lpnum.float128.h. |
|
|
Set des = op1/op2.
Definition at line 409 of file eg_lpnum.float128.h. |
|
|
Value: ({\
(dest) = (orig);\
(dest).high ^= 0x8000000000000000LL;})
Definition at line 397 of file eg_lpnum.float128.h. |
|
|
Value: ({\
__lpnum_float128__ = float128_mul (orig, orig);\
(dest) = float128_div ( __lpnum_float128__, den);\
})
Definition at line 368 of file eg_lpnum.float128.h. |
|
|
copy the value of the sum of the second and third parameter
Definition at line 330 of file eg_lpnum.float128.h. |
|
|
Divide a given number by the value of the second number.
Definition at line 520 of file eg_lpnum.float128.h. |
|
|
Value: ({\
__lpnum_float128__ = int64_to_float128((long long)(b));\
(a) = float128_div(a,__lpnum_float128__);})
Definition at line 531 of file eg_lpnum.float128.h. |
|
|
Value: ({\
unsigned int __i = 0;\
const f64dbl_t __exp = {.dbl = (exp)};\
int __lsgn = __exp.dbl <0 ? 1:0;\
float128 __ntmp,__res,__lexp,__err,__fint;\
__lext = float64_to_float128(__exp.fl);\
__lexp.high &= 0x7fffffffffffffffLL;\
__ntmp = int32_to_float128(1);\
__res = int32_to_float128(1);\
__err = float128_div(__ntmp,__res);\
while(float128_lt(float128_eps,__err))\
{\
__ntmp = float128_mul(__ntmp,__lexp);\
__fint = int32_to_float128(++__i);\
__ntmp = float128_div(__ntmp,__fint);\
__res = float128_add(__res,__ntmp);\
__err = float128_div(__ntmp,__res);\
}\
if(__lsgn) num = float128_div(float128_oneLpNum,__res);\
else num = __res;})
and store it in the given float128 number.
Definition at line 59 of file eg_lpnum.float128.h. |
|
|
Value: do{\ (a) = float128_round_to_int(b);\ if(float128_lt(b,a)) (a) = float128_sub((a),float128_oneLpNum);} while(0)
Definition at line 170 of file eg_lpnum.float128.h. |
|
|
given an array of type float128, free it, if the pointer is NULL nothing happen.
Definition at line 104 of file eg_lpnum.float128.h. |
|
|
Value: ({\
const f64dbl_t __tmp = {.fl = float128_to_float64(a)};\
char *__str=0;\
unsigned int __i = snprintf(__str,0,"%.7lg",__tmp.dbl);\
__str = EGsMalloc(char,__i+1);\
snprintf(__str,__i+1,"%.7lg",__tmp.dbl);\
__str;})
Definition at line 93 of file eg_lpnum.float128.h. |
|
|
initialize the internal memory of a given variable
Definition at line 585 of file eg_lpnum.float128.h. |
|
|
store the (multiplicative) inverse of a number to itself, i.e. implement a = 1/a.
Definition at line 178 of file eg_lpnum.float128.h. |
|
|
Value: ({\
__lpnum_float128__ = float128_sub (a, b);\
float128_lt(__lpnum_float128__, c);\
})
Definition at line 257 of file eg_lpnum.float128.h. |
|
|
Compare if two numbers are equal within a maximum error.
Definition at line 188 of file eg_lpnum.float128.h. |
|
|
Value: ({\
__lpnum_float128__ = float128_sub (a, b);\
__lpnum_float128__.high &= 0x7fffffffffffffffLL;\
float128_le(__lpnum_float128__, error);\
})
Definition at line 201 of file eg_lpnum.float128.h. |
|
|
Value: ({\
f64dbl_t __tmp = {.dbl = (b)};\
__lpnum_float128__ = float64_to_float128(__tmp.fl);\
float128_lt(__lpnum_float128__,a);})
Definition at line 285 of file eg_lpnum.float128.h. |
|
|
test if the first number is bigger to the second number
Definition at line 299 of file eg_lpnum.float128.h. |
|
|
test if the first number is bigger to the second number
Definition at line 230 of file eg_lpnum.float128.h. |
|
|
Value: ({\
f64dbl_t __tmp = {.dbl = (b)};\
__lpnum_float128__ = float64_to_float128(__tmp.fl);\
float128_lt(a,__lpnum_float128__);})
Definition at line 271 of file eg_lpnum.float128.h. |
|
|
Value: ({\
__lpnum_float128__ = float128_sub(a, b);\
__lpnum_float128__.high &= 0x7fffffffffffffffLL;\
float128_lt(error,__lpnum_float128__);})
Definition at line 207 of file eg_lpnum.float128.h. |
|
|
Definition at line 219 of file eg_lpnum.float128.h. |
|
|
Definition at line 218 of file eg_lpnum.float128.h. |
|
|
Value: ({\
__lpnum_float128__= (a);\
__lpnum_float128__.high &= 0x7fffffffffffffffLL;\
float128_lt(error,__lpnum_float128__);\
})
Definition at line 212 of file eg_lpnum.float128.h. |
|
|
Value: ({\
__lpnum_float128__ = float128_add( a, b);\
float128_lt(__lpnum_float128__, c);\
})
Definition at line 242 of file eg_lpnum.float128.h. |
|
|
Multiply a given number by the value of the second number.
Definition at line 509 of file eg_lpnum.float128.h. |
|
|
Value: ({\
__lpnum_float128__ = int64_to_float128((long long)(b));\
(a) = float128_mul(a,__lpnum_float128__);})
Definition at line 544 of file eg_lpnum.float128.h. |
|
|
Reset the value of the pointed number to one.
Definition at line 562 of file eg_lpnum.float128.h. |
|
|
Value: ({\
int __i =0;\
f64dbl_t __tmp;\
sscanf(str,"%lf%n",&(__tmp.dbl),&__i);\
(a) = float64_to_float128(__tmp.fl);\
__i;})
Definition at line 83 of file eg_lpnum.float128.h. |
|
|
Value: ({ \
float128** __ptr__ = (lptr); \
unsigned __sz__ = (lsize); \
unsigned *__ntmp__ = (unsigned *) *__ptr__; \
register unsigned __psz__; \
/* if no memory allocated before we just call the regular allocator */ \
if (!*__ptr__) *__ptr__ = float128_EGlpNumAllocArray (__sz__); \
else \
{ \
/* first check that the previous size is not larger than the current */ \
__ntmp__--; \
__psz__ = __ntmp__[0]; \
if (__psz__ < __sz__) \
{ \
/* now we have to do the reallocation */ \
*__ptr__ = (float128 *) __ntmp__; \
*__ptr__ = EGrealloc(*__ptr__, sizeof(float128) * __sz__ +sizeof(unsigned));\
__ntmp__ = (unsigned *) *__ptr__; \
__ntmp__[0] = __sz__; \
__ntmp__++; \
*__ptr__ = (float128 *) __ntmp__; \
for (; __psz__ < __sz__; __psz__++) (*__ptr__)[__psz__] = (float128){0,0}; \
} \
} \
})
Definition at line 109 of file eg_lpnum.float128.h. |
|
|
Value: set the given number pointer, set its value to the given double.
Definition at line 156 of file eg_lpnum.float128.h. |
|
|
Value: ({\
__lpnum_float128__= (orig);\
__lpnum_float128__.high &= 0x7fffffffffffffffLL;\
if (float128_lt(dest, __lpnum_float128__)) (dest) = __lpnum_float128__;})
Definition at line 349 of file eg_lpnum.float128.h. |
|
|
Value: ({\
__lpnum_float128__= (orig);\
__lpnum_float128__.high &= 0x7fffffffffffffffLL;\
if (float128_lt( __lpnum_float128__, dest)) (dest) = __lpnum_float128__;})
Definition at line 354 of file eg_lpnum.float128.h. |
|
|
Change the sign of the number.
Definition at line 570 of file eg_lpnum.float128.h. |
|
|
Value: ({\
__lpnum_float128__ = float128_mul(b, c);\
(a) = float128_sub(a, __lpnum_float128__);\
})
Definition at line 436 of file eg_lpnum.float128.h. |
|
|
Substract to a given number the value of the second number.
Definition at line 498 of file eg_lpnum.float128.h. |
|
|
Value: ({\
__lpnum_float128__ = int64_to_float128((long long)(b));\
(a) = float128_sub(a,__lpnum_float128__);})
Definition at line 463 of file eg_lpnum.float128.h. |
|
|
Value: return the closest double value of the given pointer number.
Definition at line 579 of file eg_lpnum.float128.h. |
|
|
Reset the value of the pointed number to zero.
Definition at line 554 of file eg_lpnum.float128.h. |
|
|
Definition at line 51 of file eg_lpnum.float128.h. |
|
|
Definition at line 50 of file eg_lpnum.float128.h. |
|
|
Definition at line 49 of file eg_lpnum.float128.h. |
|
|
Add to a given number the product of two numbers.
Definition at line 352 of file eg_lpnum.fp20.h. |
|
|
Add to a given number the value of the second number.
Definition at line 383 of file eg_lpnum.fp20.h. |
|
|
Add to a given number the value of the second number.
Definition at line 373 of file eg_lpnum.fp20.h. |
|
|
Allocate and initialize (if needed) 'size' elements of type int and return it, if no more memory, exit(1).
Definition at line 84 of file eg_lpnum.fp20.h. |
|
|
Value: ({\
fp20_EGlpNumFloor(a,b);\
if((a) < (b)) (a) += fp20_oneLpNum;\
(a);})
Definition at line 103 of file eg_lpnum.fp20.h. |
|
|
free the internal memory of a given variable
Definition at line 481 of file eg_lpnum.fp20.h. |
|
|
copy the value of the second number to the first.
Definition at line 252 of file eg_lpnum.fp20.h. |
|