Back: FloatE-coercing Up: Base classes Forward: FloatQ class-byte-order dependancies   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

1.78 FloatQ

Defined in namespace Smalltalk
Superclass: Float
Category: Language-Data types
My instances represent floating point numbers that have the same accuracy as C's "long double" numbers.

1.78.1 FloatQ class: byte-order dependancies  (class)
1.78.2 FloatQ class: characterization  (class)
1.78.3 FloatQ class: converting  (class)
1.78.4 FloatQ: built ins  (instance)
1.78.5 FloatQ: coercing  (instance)
1.78.6 FloatQ: misc math  (instance)


1.78.1 FloatQ class: byte-order dependancies

signByte
Answer the byte of the receiver that contains the sign bit


1.78.2 FloatQ class: characterization

decimalDigits
Return the number of decimal digits of precision for a FloatQ. Technically, if P is the precision for the representation, then the decimal precision Q is the maximum number of decimal digits such that any floating point number with Q base 10 digits can be rounded to a floating point number with P base 2 digits and back again, without change to the Q decimal digits.

e
Returns the value of e. Hope is that it is precise enough

emax
Return the maximum allowable exponent for a FloatQ that is finite.

emin
Return the maximum allowable exponent for a FloatQ that is finite.

fmax
Return the largest normalized FloatQ that is not infinite.

fminNormalized
Return the smallest normalized FloatQ that is > 0

infinity
Return a FloatQ that represents positive infinity.

ln10
Returns the value of ln 10. Hope is that it is precise enough

log10Base2
Returns the value of log2 10. Hope is that it is precise enough

nan
Return a FloatQ that represents a mathematically indeterminate value (e.g. Inf - Inf, Inf / Inf).

negativeInfinity
Return a FloatQ that represents negative infinity.

pi
Returns the value of pi. Hope is that it is precise enough

precision
Answer the number of bits in the mantissa. 1 + (2^-precision) = 1


1.78.3 FloatQ class: converting

coerce: aNumber
Answer aNumber converted to a FloatQ


1.78.4 FloatQ: built ins

* arg
Multiply the receiver and arg and answer another Number

+ arg
Sum the receiver and arg and answer another Number

- arg
Subtract arg from the receiver and answer another Number

/ arg
Divide the receiver by arg and answer another FloatQ

< arg
Answer whether the receiver is less than arg

<= arg
Answer whether the receiver is less than or equal to arg

= arg
Answer whether the receiver is equal to arg

> arg
Answer whether the receiver is greater than arg

>= arg
Answer whether the receiver is greater than or equal to arg

asFloatD
Answer the receiver converted to a FloatD

asFloatE
Answer the receiver converted to a FloatE

exponent
Answer the exponent of the receiver in mantissa*2^exponent representation ( |mantissa|<=1 )

fractionPart
Answer the fractional part of the receiver

timesTwoPower: arg
Answer the receiver multiplied by 2^arg

truncated
Truncate the receiver towards zero and answer the result

~= arg
Answer whether the receiver is not equal to arg


1.78.5 FloatQ: coercing

asFloatQ
Just defined for completeness. Return the receiver.

coerce: aNumber
Coerce aNumber to the receiver's class

generality
Answer the receiver's generality

unity
Coerce 1 to the receiver's class

zero
Coerce 0 to the receiver's class


1.78.6 FloatQ: misc math

raisedTo: aNumber
Return self raised to aNumber power



Back: FloatQ-coercing Up: FloatQ Forward: Fraction   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document


This document was generated on May, 22 2008 using texi2html