BigNumberclassbignum.h[37], reflect.t[407]

The BigNumber intrinsic class lets you perform floating-point and integer arithmetic with (almost) any desired precision. BigNumber uses a decimal representation, which means that decimal values can be represented exactly (i.e., with no rounding errors, as can happen with IEEE 'double' and 'float' values that languages like C typically support). BigNumber combines a varying-length mantissa with an exponent; the length of the mantissa determines how many digits of precision a given BigNumber can store, and the exponent lets you represent very large or very small values with minimal storage. You can specify the desired precision when you create a BigNumber explicitly; when BigNumber values are created implicitly by computations, the system chooses a precision based on the inputs to the calculations, typically equal to the largest of the precisions of the input values.

The maximum precision for a BigNumber is about 64,000 digits, and the exponent can range from -32768 to +32767. Since this is a decimal exponent, this implies an absolute value range from 1.0e-32768 to 1.0e+32767. The more digits of precision stored in a given BigNumber value, the more memory the object consumes, and the more time it takes to perform calculations using the value.

Modified in reflect.t[407]:
If desired, modify the BigNumber intrinsic class to provide a to-symbol mapping. We only include this modification if the program is compiled with REFLECT_BIGNUM defined.

intrinsic class BigNumber :   Object

Superclass Tree   (in declaration order)


Subclass Tree  


Global Objects  


Summary of Properties  


Summary of Methods  

arccosine  arcsine  arctangent  copySignFrom  cosh  cosine  degreesToRadians  divideBy  equalRound  expE  formatString  getAbs  getCeil  getE  getFloor  getFraction  getPi  getPrecision  getScale  getWhole  isNegative  log10  logE  negate  numType  radiansToDegrees  raiseToPower  roundToDecimal  scaleTen  setPrecision  sine  sinh  sqrt  tangent  tanh  valToSymbol 

Inherited from Object :
getPropList  getPropParams  getSuperclassList  isClass  isTransient  ofKind  propDefined  propInherited  propType 




arccosine ( )bignum.h[182]

Calculate and return the arccosine (in radians). The value must be between -1 and +1 inclusive.

arcsine ( )bignum.h[176]
Calculate and return the arcsine (in radians) of the value. Note that the value must be between -1 and +1 inclusive, since sine() never has a value outside of this range.

arctangent ( )bignum.h[185]
calculate and return the arctangent (in radians)

copySignFrom (x)bignum.h[104]
copySignFrom - combine the absolute value of self with the sign of x

cosh ( )bignum.h[213]
no description available

cosine ( )bignum.h[151]
calculate and return the trigonometric cosine of the value (taken as a radian value)

degreesToRadians ( )bignum.h[163]
interpreting this number as a number of degrees, convert the value to radians and return the result

divideBy (x)bignum.h[139]
Calculate the integer quotient and the remainder; returns a list whose first element is the integer quotient (a BigNumber containing an integer value), and whose second element is the remainder (the value R such that dividend = quotient*x + R).

Note that the quotient returned will not necessarily have the same value as the whole part of dividing self by x with the '/' operator, because this division handles rounding differently. In particular, the '/' operator will perform the appropriate rounding on the quotient if the quotient has insufficient precision to represent the exact result. This routine, in contrast, does NOT round the quotient, but merely truncates any trailing digits that cannot be represented in the result's precision. The reason for this difference is that it ensures that the relation (dividend=quotient*x+remainder) holds, which would not always be the case if the quotient were rounded up.

Note also that the remainder will not necessarily be less than the divisor. If the quotient cannot be exactly represented (which occurs if the precision of the quotient is smaller than its scale), the remainder will be the correct value so that the relationship above holds, rather than the unique remainder that is smaller than the divisor. In all cases where there is sufficient precision to represent the quotient exactly (to the units digit only, since the quotient returned from this method will always be an integer), the remainder will satisfy the relationship AND will be the unique remainder with absolute value less than the divisor.

equalRound (num)bignum.h[47]
compare for equality after rounding to the smaller of my precision and num's precision

expE ( )bignum.h[200]
raise e (the base of the natural logarithm) to the power of this value and return the result

formatString (maxDigits?, flags?, wholePlaces?, fracDigits?, expDigits?, leadFiller?)bignum.h[40]
format to a string

getAbs ( )bignum.h[79]
return the absolute value

getCeil ( )bignum.h[82]
least integer greater than or equal to this number

getE (digits)bignum.h[220]
class method: get the value of e to a given precision

getFloor ( )bignum.h[85]
greatest integer less than or equal to this number

getFraction ( )bignum.h[66]
get the fractional part

getPi (digits)bignum.h[217]
class method: get the value of pi to a given precision

getPrecision ( )bignum.h[53]
returns an integer giving the number of digits of precision that this number stores

getScale ( )bignum.h[88]
get the base-10 scale of the number

getWhole ( )bignum.h[69]
get the whole part (truncates the fraction - doesn't round)

isNegative ( )bignum.h[107]
determine if the value is negative

log10 ( )bignum.h[203]
calculate the base-10 logarithm of the number and return the result

logE ( )bignum.h[194]
calculate the natural logarithm of this number and return the result

negate ( )bignum.h[98]
negate - invert the sign of the number

numType ( )bignum.h[228]
Get the type of this number. This returns a combination of NumTypeXxx flags, combined with the '|' operator. This can be used to check for special values, such as infinites and "not a number" values.

radiansToDegrees ( )bignum.h[169]
interpreting this number as a number of radians, convert the value to degrees and return the result

raiseToPower (x)bignum.h[209]
raise this number to the power of the argument and return the result

roundToDecimal (places)bignum.h[76]
round to the given number of digits after the decimal point; if the value is zero, round to integer; if the value is negative, round to the given number of places before the decimal point

scaleTen (x)bignum.h[95]
scale by 10^x - if x is positive, this multiplies the number by ten the given number of times; if x is negative, this divides the number by ten the given number of times

setPrecision (digits)bignum.h[63]
Return a new number, with the same value as this number but with the given number of decimal digits of precision. If the new precision is higher than the old precision, this will increase the precision to the requested new size and add trailing zeros to the value. If the new precision is lower than the old precision, we'll round the number for the reduced precision.

sine ( )bignum.h[145]
calculate and return the trigonometric sine of the value (taken as a radian value)

sinh ( )bignum.h[212]
calculate the hyperbolic sine, cosine, and tangent

sqrt ( )bignum.h[188]
calculate the square root and return the result

tangent ( )bignum.h[157]
calculate and return the trigonometric tangent of the value (taken as a radian value)

tanh ( )bignum.h[214]
no description available

valToSymbol ( )OVERRIDDENreflect.t[408]
no description available

TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3