eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'QDouble':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: QDouble


Inheritance:

   Object
   |
   +--Magnitude
      |
      +--ArithmeticValue
         |
         +--Number
            |
            +--LimitedPrecisionReal
               |
               +--QDouble

Package:
stx:libbasic2
Category:
Magnitude-Numbers
Version:
rev: 1.45 date: 2019/07/19 15:29:05
user: cg
file: QDouble.st directory: libbasic2
module: stx stc-classLibrary: libbasic2
Author:
Claus Gittinger

Description:


ATTENTION: ongoing, unfinished work.
No warranty that this works correctly...

QDoubles represent rational numbers with extended, but still limited precision.

In contrast to Floats (which use the C-compiler's native 64bit 'double' format),
QDoubles give you roughly 200 bit or approx. 60 decimal digits of precision.

Representation:
    QDoubles use 4 IEEE doubles, each keeping 53 bits of precision.
    A qDouble's value is the sum of those 4 doubles,
    and a qDouble keeps this unevaluated sum as its state.
    (due to overlap, the final precision is less than 53*4)

Range and Precision of Storage Formats: see LimitedPrecisionReal >> documentation
the number of decmal digits:
    QDouble decimalPrecision
    LongFloat decimalPrecision
    Float decimalPrecision
    ShortFloat decimalPrecision

the number of bits:
    QDouble precision
    LongFloat precision
    Float precision
    ShortFloat precision

Notice:
    when assigning a converted double precision number as in:
        qd := 1.0 asQDouble.
    you still get only a regular double precision approximation to 0.1
    because the error is already inherit in the double.

    For a full precision constant, you (currently) need to convert from a string
    (because the compilers do not know about then, yet):
        qd := QDouble readFrom:'0.1'.

    To see the error of the double precision version, compute:
        (0.1 asQDouble) - (QDouble readFrom:'0.1')


Related information:

    Number
    Float
    ShortFloat
    LongFloat
    Fraction
    FixedPoint
    Integer
    Complex
    FloatArray
    DoubleArray

Class protocol:

coercing & converting
o  coerce: aNumber
convert the argument aNumber into an instance of the receiver's class and return it.

constants
o  NaN
return a QDouble which represents not-a-Number (i.e. an invalid number)

o  e
return the constant e as quad precision double.
(returns approx. 200 bits of precision)

usage example(s):

     self e

o  fmax
return the constant e as quad precision double.
(returns approx. 200 bits of precision)

usage example(s):

     Float fmax
     self fmax

o  fmin
return the smallest representable instance of this class

usage example(s):

     QDouble fmin
     Float fmin

o  infinity
(comment from inherited method)
return an instance of myself which represents positive infinity (for my instances).
Warning: do not compare equal against infinities;
instead, check using isFinite or isInfinite

o  invFact
table returning 1/n!
(for taylor series)

usage example(s):

     1.0 / (3 factorial)  0.166666666666667

     1 asQDouble / (3 factorial) - (self invFact at:1)
     1 asQDouble / (4 factorial) - (self invFact at:2)
     1 asQDouble / (5 factorial) - (self invFact at:3)
     1 asQDouble / (6 factorial) - (self invFact at:4)
     1 asQDouble / (7 factorial) - (self invFact at:5)
     1 asQDouble / (8 factorial) - (self invFact at:6)
     1 asQDouble / (9 factorial) - (self invFact at:7)
     1 asQDouble / (10 factorial) - (self invFact at:8)
     1 asQDouble / (11 factorial) - (self invFact at:9)
     1 asQDouble / (12 factorial) - (self invFact at:10)
     1 asQDouble / (13 factorial) - (self invFact at:11)
     1 asQDouble / (14 factorial) - (self invFact at:12)
     1 asQDouble / (15 factorial) - (self invFact at:13)
     1 asQDouble / (16 factorial) - (self invFact at:14)
     1 asQDouble / (17 factorial) - (self invFact at:15)

o  ln10
return the constant e as quad precision double.
(returns approx. 200 bits of precision)

usage example(s):

     self ln10

o  ln2
return the constant e as quad precision double.
(returns approx. 200 bits of precision)

usage example(s):

     self ln2

o  negativeInfinity
(comment from inherited method)
return an instance of myself which represents negative infinity (for my instances).
Warning: do not compare equal against infinities;
instead, check using isFinite or isInfinite

o  pi
return the constant pi as quad precision double.
(returns approx. 200 bits of precision)

usage example(s):

     self pi

o  unity
return the neutral element for multiplication (1.0) as QDouble

usage example(s):

     self unity

o  zero
return the neutral element for addition (0.0) as QDouble

usage example(s):

     self zero

instance creation
o  basicNew
return a new quad-precision double - here we return 0.0
Notice that numbers are usually NOT created this way ...
It's implemented here to allow things like binary store & load
of floats. (but even this support will go away eventually, it's not
a good idea to store the bits of a float - the reader might have a
totally different representation - so floats should be
binary stored in a device independent format.

usage example(s):

     self basicNew

o  d0: d0 d1: d1 d2: d2 d3: d3
return a new quad-precision double from individual double components

usage example(s):

     self d0: 3.141592653589793116e+00
	  d1: 1.224646799147353207e-16
	  d2: -2.994769809718339666e-33
	  d3: 1.112454220863365282e-49

o  fromDoubleArray: aDoubleArray
return a new quad-precision double from coercing a double array

o  fromFloat: aFloat
return a new quad-precision double from coercing aFloat

usage example(s):

     self fromFloat:1.0

o  fromInteger: anInteger
return a new quad-precision double from coercing anInteger

usage example(s):

     self fromInteger:2
     self fromInteger:16rFFFFFFFF            -- 32bit 4294967295.0
     self fromInteger:16rFFFFFFFFFFFF        -- 48bit 281474976710655.0
     self fromInteger:16rFFFFFFFFFFFFF       -- 52bit 4503599627370495.0
     self fromInteger:16rFFFFFFFFFFFFFF      -- 56bit 72057594037927935.0
     self fromInteger:16rFFFFFFFFFFFFFFF     -- 60bit 1152921504606846975.0
     self fromInteger:16r1FFFFFFFFFFFFFFF    -- 61bit 2305843009213693951.0
     self fromInteger:16r3FFFFFFFFFFFFFFF    -- 62bit 4611686018427387903.0
     self fromInteger:16r7FFFFFFFFFFFFFFF    -- 63bit 9223372036854775807.0
     self fromInteger:16rFFFFFFFFFFFFFFFF    -- 64bit 18446744073709551615.0

queries
o  defaultPrintPrecision
return the number of decimal digits printed by default

usage example(s):

     ShortFloat defaultPrintPrecision
     Float defaultPrintPrecision
     LongFloat defaultPrintPrecision
     QDouble defaultPrintPrecision

o  epsilon
return the maximum relative spacing of instances of mySelf
(i.e. the value-delta of the least significant bit)

usage example(s):

     Float epsilon       -> 2.22044604925031E-16
     ShortFloat epsilon  -> 1.19209289550781E-07
     LongFloat epsilon   -> 1.0842021724855E-19
     QDouble epsilon     -> 1.21543267145725E-63

o  numBitsInExponent
answer the number of bits in the exponent

usage example(s):

     1.0 asQDouble numBitsInExponent

o  numBitsInMantissa
answer the number of bits in the mantissa.
Here, a fake number is returned

usage example(s):

     1.0 asFloat numBitsInMantissa
     1.0 asShortFloat numBitsInMantissa
     1.0 asLongFloat numBitsInMantissa
     1.0 asQDouble numBitsInMantissa
     1.0 asQDouble class numBitsInMantissa

     Float numBitsInMantissa
     ShortFloat numBitsInMantissa
     QDouble numBitsInMantissa

o  precision
answer the number of bits in the mantissa

usage example(s):

     1.0 class numBitsInMantissa
     1.0 asShortFloat class numBitsInMantissa
     1.0 asLongFloat class numBitsInMantissa
     1.0 asQDouble class numBitsInMantissa

     Float numBitsInMantissa
     ShortFloat numBitsInMantissa
     QDouble numBitsInMantissa
     QDouble precision

o  radix
answer the radix of a QDouble's exponent
This is an IEEE float, which is represented as binary


Instance protocol:

arithmetic
o  * aNumber
return the product of the receiver and the argument, aNumber

usage example(s):

     (((QDouble fromFloat:1e20) + (QDouble fromFloat:1.0)) * (QDouble fromFloat:2.0)) asDoubleArray

o  + aNumber
return the sum of the receiver and the argument, aNumber

usage example(s):

     ((QDouble fromFloat:1e20) + (QDouble fromFloat:1.0)) asDoubleArray

o  - aNumber
return the sum of the receiver and the argument, aNumber

usage example(s):

     (QDouble fromFloat:1e20) asDoubleArray
     ((QDouble fromFloat:1e20) - (QDouble fromFloat:1.0)) asDoubleArray
     (QDouble fromFloat:1e-20) asDoubleArray
     ((QDouble fromFloat:1e-20) - (QDouble fromFloat:1.0)) asDoubleArray
     ((QDouble fromFloat:2.0) - (QDouble fromFloat:1.0)) asDoubleArray

     ((QDouble fromFloat:2.0) - (QDouble fromFloat:1.0) + (QDouble fromFloat:1.0)) asDoubleArray
     ((QDouble fromFloat:1e-20) - (QDouble fromFloat:1.0) + (QDouble fromFloat:1.0)) asDoubleArray

usage example(s):

Modified (comment): / 15-06-2017 / 00:34:41 / cg

o  / aNumber
return the quotient of the receiver and the argument, aNumber

usage example(s):

     ((QDouble fromFloat:1e20) / (QDouble fromFloat:2.0)) asDoubleArray

     ((QDouble fromFloat:1.2345) / (QDouble fromFloat:10.0)) asDoubleArray
     ((QDouble fromFloat:1.2345) / 10.0) asDoubleArray

usage example(s):

Modified (comment): / 15-06-2017 / 00:14:26 / cg

coercing & converting
o  asDoubleArray
(QDouble fromFloat:1.0) asDoubleArray
(QDouble fromFloat:2.0) asDoubleArray

o  asFloat
(QDouble fromFloat:1.0) asFloat
(QDouble fromFloat:2.0) asFloat

o  asInteger
(comment from inherited method)
return an integer with same value - might truncate

o  asQDouble
return a QDouble with same value as myself.

o  asTrueFraction
1e10 asTrueFraction -> 10000000000
1e20 asTrueFraction -> 100000000000000000000
(1e20 + 1) asTrueFraction -> 100000000000000000000 ouch!

1e10 asQDouble asTrueFraction -> 10000000000
1e20 asQDouble asTrueFraction -> 100000000000000000000
(1e20 asQDouble + 1) asTrueFraction -> 100000000000000000001

(1e40 asQDouble + 1e20 + 1) asTrueFraction -> 10000000000000000303886028427003666890753
(1e40 asQDouble + 1e20) asTrueFraction

o  coerce: aNumber
convert the argument aNumber into an instance of the receiver's class and return it.

o  exponent
(comment from inherited method)
extract a normalized float's exponent.
This is a fallback for systems which do not provide frexp in their math lib,
als also for error reporting (NaN or Inf).
The returned value depends on the float-representation of
the underlying machine and is therefore highly unportable.
This is not for general use.
This assumes that the mantissa is normalized to
0.5 .. 1.0 and the float's value is mantissa * 2^exp

o  generality
return the generality value - see ArithmeticValue>>retry:coercing:

o  negative
(QDouble fromFloat:0.0) negative
(QDouble fromFloat:1.0) negative
(QDouble fromFloat:-1.0) negative

o  positive
return true, if the receiver is greater or equal to zero (not negative)

usage example(s):

     (QDouble fromFloat:1.0) positive
     (QDouble fromFloat:-1.0) positive

comparing
o  < aNumber
return true, if the argument, aNumber is greater than the receiver

o  = aNumber
return true, if the argument, aNumber has the same value as than the receiver

double dispatching
o  differenceFromFloat: aFloat
aFloat - self

o  differenceFromQDouble: aQDouble
aQDouble - self

o  equalFromQDouble: aQDouble
(QDouble fromFloat:1.0) = (QDouble fromFloat:1.0)
(QDouble fromFloat:1.0) = 1.0
1.0 = (QDouble fromFloat:1.0)

o  lessFromQDouble: aQDouble
sent when aQDouble does not know how to compare to the receiver..
Return true if aQDouble < self

o  productFromFloat: aFloat
loosing bits here:

(1e20+1.0)*2.0
(1e20+1.0)*1e20
(1e40+1.0)*2.0

but not here:

(1.0 asQDouble) * 2.0
((1e20 asQDouble) + (1.0)) * 2.0
((1e20 asQDouble) + (1.0)) * 100.0 10000000000000000000100.0
((1e20 asQDouble) + (1.0)) * 1000.0
((1e40 asQDouble) + (1.0)) * 2.0

2.0 * (QDouble fromFloat:1.0)
2.0 * (QDouble fromFloat:3.0)
(QDouble fromFloat:2.0) * (QDouble fromFloat:3.0)

QDouble ln2 DoubleArray(0.693147180559945 2.3190468138463E-17 5.70770843841621E-34 -3.58243221060181E-50)
2.0 * QDouble ln2 DoubleArray(1.38629436111989 4.6380936276926E-17 1.14154168768324E-33 -7.16486442120362E-50)
QDouble ln2 * 2.0

2.0 * ((QDouble fromFloat:1e20) + (QDouble fromFloat:1.0)) DoubleArray(2E+20 2.0 0.0 0.0)
((QDouble fromFloat:1e20) + (QDouble fromFloat:1.0)) * 2.0 DoubleArray(2E+20 4E+20 0.0 0.0)
((QDouble fromFloat:1e20) + (QDouble fromFloat:1.0)) * (QDouble fromFloat:2.0) DoubleArray(2E+20 4E+20 0.0 0.0)
(QDouble fromFloat:2.0) * ((QDouble fromFloat:1e20) + (QDouble fromFloat:1.0)) DoubleArray(2E+20 4E+20 0.0 0.0)

(2.0 * ((QDouble fromFloat:1e20) + (QDouble fromFloat:1.0))) - (QDouble fromFloat:1e20) - (QDouble fromFloat:1e20)

(2.0 * (QDouble fromFloat:1.0)) asFloat
(1e20 * (QDouble fromFloat:1.0)) asFloat

(1e20 * (QDouble fromFloat:1.0) * 1e-20) asDoubleArray

o  productFromQDouble: aQDouble
(QDouble fromFloat:1.0) * 2.0
2.0 * (QDouble fromFloat:1.0)
(QDouble fromFloat:1.0) * (QDouble fromFloat:2.0)

1e20 * (QDouble fromFloat:1.0)
(2.0 * (QDouble fromFloat:1.0)) asFloat
(1e20 * (QDouble fromFloat:1.0)) asFloat

(1e20 * (QDouble fromFloat:1.0) * 1e-20) asDoubleArray

( ((QDouble fromFloat:1.0) + (QDouble fromFloat:1e20)) * (QDouble fromFloat:2.0)) asDoubleArray

o  quotientFromQDouble: aQDouble
sloppy

usage example(s):

     2.0 / (QDouble fromFloat:2.0)
     2.0 / (QDouble fromFloat:1.0)
     1e20 / (QDouble fromFloat:1.0)
     (2.0 / (QDouble fromFloat:1.0)) asFloat
     (1e20 / (QDouble fromFloat:1.0)) asFloat

     (QDouble fromFloat:2.0) / 2.0
     (QDouble fromFloat:1e20) / 2.0
     ((QDouble fromFloat:1.0) / 2.0) asFloat
     ((QDouble fromFloat:1e20 / 2.0)) asFloat

     ((1e20 + (QDouble fromFloat:1.0) + 1e-20) / 2.0) asDoubleArray

     ((QDouble fromFloat:10.0) quotientFromQDouble: (QDouble fromFloat:1.234)) asDoubleArray
     ((QDouble fromFloat:1.234) / (QDouble fromFloat:10.0)) asDoubleArray

q0: 1.234000e-01 (a[0]=1.234000e+00; b[0]=1.000000e+01)
a: 1.234000e+00/0.000000e+00/0.000000e+00/0.000000e+00
b: 1.000000e+01/0.000000e+00/0.000000e+00/0.000000e+00
(b * q0): 1.234000e+00/-2.775558e-17/0.000000e+00/0.000000e+00
r: 2.775558e-17/0.000000e+00/0.000000e+00/0.000000e+00

q1: 2.775558e-18 (r[0]=2.775558e-17; b[0]=1.000000e+01)
r: -1.540744e-33/0.000000e+00/0.000000e+00/0.000000e+00

q2: -1.540744e-34 (r[0]=-1.540744e-33; b[0]=1.000000e+01)
r: 8.552847e-50/0.000000e+00/0.000000e+00/0.000000e+00

q3: 8.552847e-51 (r[0]=8.552847e-50; b[0]=1.000000e+01)

before renorm: 1.234000e-01/2.775558e-18/-1.540744e-34/8.552847e-51
after renorm: 1.234000e-01/2.775558e-18/-1.540744e-34/8.552847e-51
1.234/10.0 is: 0.123400 / 0.000000 / -0.000000 / 0.000000

o  sumFromFloat: aFloat
1.0 + (QDouble fromFloat:1.0)
1e20 + (QDouble fromFloat:1.0)
(1.0 + (QDouble fromFloat:1.0)) asFloat
(1e20 + (QDouble fromFloat:1.0)) asFloat

(1.0 + (QDouble fromFloat:1.0)) asDoubleArray
(1e20 + (QDouble fromFloat:1.0)) asDoubleArray
(1e20 + (QDouble fromFloat:1.0) + 1e-20) asDoubleArray

o  sumFromInteger: anInteger
1 + (QDouble fromFloat:1.0)
1e20 asInteger + (QDouble fromFloat:1.0)
(1 + (QDouble fromFloat:1.0)) asFloat
(1e20 asInteger + (QDouble fromFloat:1.0)) asFloat

o  sumFromQDouble: aQDouble
(QDouble fromFloat:1.0) + (QDouble fromFloat:1.0)
(QDouble fromFloat:1.0) + 1.0
1.0 + (QDouble fromFloat:1.0)

((QDouble fromFloat:1.0) + (QDouble fromFloat:1.0)) asDoubleArray
((QDouble fromFloat:1.0) + 1.0) asDoubleArray
(1.0 + (QDouble fromFloat:1.0)) asDoubleArray
(1e-20 + (QDouble fromFloat:1.0)) asDoubleArray
(1e20 + (QDouble fromFloat:1.0)) asDoubleArray

inspecting
o  inspectorExtraAttributes
extra (pseudo instvar) entries to be shown in an inspector.

mathematical functions
o  exp
the exp_sloppy code is the algorithm from the original C++ qd package;

usage example(s):

     2.0 exp                -> 7.38905609893065
     2.0 asQDouble exp      -> 7.38905609893065022723

     2 asQDouble exp printfPrintString:'%70.68f'
	    -> 7.389056098930650227230427460575007813180315570551847324087127822432669

     actual result:
	    -> 7.3890560989306502272304274605750078131803155705518473240871278225225737960790577633843124850791217947737531612654...

o  exp_sloppy
this is the algorithm from the qd C++ package;

o  exp_withAccuracy: epsilon
compute e^x of the receiver using a taylor series approximation.
This method is only invoked for limitedPrecisionReal classes, which do not compute
exp themself (i.e. QDouble)

o  floor
return the receiver truncated towards negative infinity

usage example(s):

     (QDouble fromFloat:4.0) floor
     (QDouble fromFloat:4.1) floor
     (QDouble fromFloat:0.1) floor
     (0.1 + (QDouble fromFloat:1.0)) floor
     (1e20 + (QDouble fromFloat:1.0)) floor

     (QDouble fromFloat:1.5) floor
     (QDouble fromFloat:0.5) floor
     (QDouble fromFloat:-0.5) floor
     (QDouble fromFloat:-1.5) floor

o  floor2
return the receiver truncated towards negative infinity

o  ln
return the natural logarithm of myself.
Raises an exception, if the receiver is less or equal to zero.

Not sure if this is really faster than using a taylor right away:
the three exp-computations at the end are done in qDouble and are tailors themself...

usage example(s):

     -1 ln

     -1.0 asQDouble ln
     0.0 asQDouble ln
     1.0 asQDouble ln

     3.0 ln printfPrintString:'%60.58lf'
	    -> 1.0986122886681097821082175869378261268138885498046875000000'
				^

     3.0 asQDouble ln printfPrintString:'%60.58f'
	    -> 1.0986122886681096913952452369225257046474905578227494517347

     3.0 asQDouble ln printfPrintString:'%70.68f'
	    -> 1.09861228866810969139524523692252570464749055782274945173469433364779

     (3.0 asQDouble ln_withAccuracy:1e-64) printfPrintString:'%70.68f'
	       1.09861228866810969139524523692252570464749055782274945173469433364475
     (3.0 asQDouble ln_withAccuracy:1e-100) printfPrintString:'%70.68f'
	      '1.098612288668109691395245236922525704647490557822749451734694333656909'

     actual result:
	    -> 1.0986122886681096913952452369225257046474905578227494517346943336374942932186089668736157548137320887879700290659...

o  negated
(QDouble fromFloat:1.0) negated
((QDouble fromFloat:1e20) + (QDouble fromFloat:1.0)) negated asDoubleArray

(((QDouble fromFloat:1e20) + (QDouble fromFloat:1.0))
+ ((QDouble fromFloat:1e20) + (QDouble fromFloat:1.0))) asDoubleArray

o  sqrt
Return the square root of the receiver

usage example(s):

this computes a roughly 65 digits precision result,
     using sqrt from the double as an initial guess

usage example(s):

FloatD is only correct in roughly 17 digits

     2 sqrt printfPrintString:'%50.48f'
	    -> 1.414213562373095145474621858738828450441360473633
				^
     QDouble gives you much more:

     2 asQDouble sqrt printfPrintString:'%50.48f'
	    -> 1.414213562373095048801688724209698078569671875377

     2 asQDouble sqrt printfPrintString:'%60.58f'
	    -> 1.4142135623730950488016887242096980785696718753769480731767'

     2 asQDouble sqrt printfPrintString:'%70.68f'
	    -> 1.41421356237309504880168872420969807856967187537694807317667973799602

     actual digits:
	    -> 1.4142135623730950488016887242096980785696718753769480731766797379907324784621070388503875343276415727350138462309...

o  squared
return receiver * receiver

usage example(s):

     (QDouble fromFloat:4.0) squared
     (1e20 + (QDouble fromFloat:1.0)) squared

printing & storing
o  digitsWithPrecision: precision
generate digits and exponent.
if precision is >0, that many digits are generated.
If it is 0 the required number of digits is generated
(but never more than the decimalPrecision, which is 65)

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  printOn: aStream
return a printed representation of the receiver.

Notice:
this code was adapted from an ugly piece of c++ code,
which was obviously hacked.
It does need a rework.
As an alternative, use the printf functions, which should also deal wth QDoubles

usage example(s):

     (1.2345 asQDouble) printOn:Transcript    . Transcript cr.
     (1.2345 asFloat) printOn:Transcript      . Transcript cr.
     (1.2345 asLongFloat) printOn:Transcript  . Transcript cr.
     (1.2345 asShortFloat) printOn:Transcript . Transcript cr.

     ((QDouble fromFloat:1.2345) / 10.0) printOn:Transcript
     ((QDouble fromFloat:1.2345) / 10000.0) printOn:Transcript
     ((QDouble fromFloat:1.2345) / 1000000000.0) printOn:Transcript

o  printOn: aStream precision: precisionIn width: width fixed: fixed showPositive: showPositive uppercase: uppercase fillChar: fillChar
return a printed representation of the receiver.
This is a parametrized entry, which can be used by printf-like functions.
Notice:
this code was adapted from an ugly piece of c++ code,
which was obviously hacked.
It does need a rework.
As an alternative, use the printf functions, which should also deal wth QDoubles


** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  round_string_qd: str at: precisionIn offset: offsetIn

** This is an obsolete interface - do not use it (it may vanish in future versions) **

private accessing
o  d0
the most significant (and highest valued) 53 bits of precision

o  d1
the next most significant (and next highest valued) 53 bits of precision

o  d2

o  d3
the least significant (and smallest valued) 53 bits of precision

o  renorm
destructive renormalization

usage example(s):

     (QDouble fromFloat:1.0) renorm

testing
o  isFinite

o  isInfinite
(comment from inherited method)
return true, if the receiver is an infinite float (Inf).
These are not created by ST/X float operations (they raise an exception);
however, inline C-code could produce them ...

o  isNaN

o  isOne

o  isZero
(comment from inherited method)
return true, if the receiver is zero


Examples:


Floats, LongFloats suffer from loosing bits: (Float readFrom:'0.3333333333333333333333333333333333333333333333333333333333') -(Float readFrom:'0.333333333333333333333333333333333333333333333333333333333') -> 0.0 (Float readFrom:'0.3333333333333333333333333333333333333333333333333333333333') = (Float readFrom:'0.333333333333333333333333333333333333333333333333333333333') -> true (Float readFrom:'0.33333333333333333333333333333333333333333333333333333333333333333333') = (Float readFrom:'0.3333333333333333333333333333333333333333333333333333333333333333333') -> true 1000 0110 1000 0101 1000 0101 1000 0101 1000 0101 1000 0101 1101 0101 0011 1111 (Float readFrom:'0.3333333333333333333333333333333333333333333333333333333333') = (Float readFrom:'0.3333333333333333333333333333333333333333333333333333333333333333333') (LongFloat readFrom:'0.3333333333333333333333333333333333333333333333333333333333') -(LongFloat readFrom:'0.333333333333333333333333333333333333333333333333333333333') -> 0.0 (LongFloat readFrom:'0.3333333333333333333333333333333333333333333333333333333333') = (LongFloat readFrom:'0.333333333333333333333333333333333333333333333333333333333') -> 0.0 (QDouble readFrom:'0.3333333333333333333333333333333333333333333333333333333333') -(QDouble readFrom:'0.333333333333333333333333333333333333333333333333333333333') (QDouble readFrom:'0.33333333333333333333333333333333333333333333333333333333333') -(QDouble readFrom:'0.3333333333333333333333333333333333333333333333333333333333') (QDouble readFrom:'0.33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333') -(QDouble readFrom:'0.3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333')

ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Mon, 26 Feb 2024 15:56:02 GMT