--- a/Float.st Fri Jul 19 17:29:09 2019 +0200
+++ b/Float.st Fri Jul 19 17:33:52 2019 +0200
@@ -213,12 +213,12 @@
In contrast to ShortFloats (32bit) and LongFloats (>=64bit).
WARNING:
- The layout of Float instances is known by the runtime system and the compiler;
- you may not add instance variables here.
- Also, subclassing is complicated by the fact, that the VM creates floats/shortFloats,
- and does some float-checks by an identity compare with the Float-class.
- (i.e. your subclasses instances may not be recognized as float-like objects,
- thus mixed mode arithmetic will always coerce them, effectively slowing things down).
+ The layout of Float instances is known by the runtime system and the compiler;
+ you may not add instance variables here.
+ Also, subclassing is complicated by the fact, that the VM creates floats/shortFloats,
+ and does some float-checks by an identity compare with the Float-class.
+ (i.e. your subclasses instances may not be recognized as float-like objects,
+ thus mixed mode arithmetic will always coerce them, effectively slowing things down).
Notice, that Floats are defined as Byte-array to prevent the garbage collector
from going into the value ... otherwise I needed a special case in many places.
@@ -233,29 +233,29 @@
instances.
Mixed mode arithmetic:
- float op float -> float
- float op fix -> float
- float op fraction -> float
- float op integer -> float
- float op shortFloat -> float
- float op longFloat -> longFloat
- float op complex -> complex
+ float op float -> float
+ float op fix -> float
+ float op fraction -> float
+ float op integer -> float
+ float op shortFloat -> float
+ float op longFloat -> longFloat
+ float op complex -> complex
Representation:
- 64bit double precision IEEE floats
- 53 bit mantissa,
- 11 bit exponent,
- 15 decimal digits (approx)
+ 64bit double precision IEEE floats
+ 52 bit mantissa + 1 hidden bit providing 53 bits of precision,
+ 11 bit exponent,
+ 15 decimal digits (approx)
Range and Precision of Storage Formats: see LimitedPrecisionReal >> documentation
[author:]
- Claus Gittinger
+ Claus Gittinger
[see also:]
- Number
- ShortFloat LongFloat Fraction FixedPoint Integer Complex
- FloatArray DoubleArray
+ Number
+ ShortFloat LongFloat Fraction FixedPoint Integer Complex
+ FloatArray DoubleArray
"
!