[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-smalltalk] Re: [PATCH] Fraction and Integer asFloat: answer neares
From: |
nicolas cellier |
Subject: |
[Help-smalltalk] Re: [PATCH] Fraction and Integer asFloat: answer nearest floating point |
Date: |
Sun, 28 Jan 2007 01:50:45 +0100 |
User-agent: |
Thunderbird 1.5.0.4 (X11/20060516) |
Some more tests:
"check for negative zero"
self assert: (1 bitShift: 1075) reciprocal asFloatD positive.
self assert: (1 bitShift: 1075) reciprocal negated asFloatD negative.
"check for infinity"
self assert: (1 bitShift: 1024) asFloatD = FloatD infinity.
self assert: (1 bitShift: 1024) negated asFloatD = FloatD negativeInfinity.
self assert: ((1 bitShift: 1075)/3) asFloatD = FloatD infinity.
self assert: ((1 bitShift: 1075)/3) negated asFloatD = FloatD
negativeInfinity.
"check for non infinity/nan"
self assert: ((1 bitShift: 1024)/3) asFloatD isFinite.
self assert: ((1 bitShift: 1024)/3) negated asFloatD isFinite.
self assert: (3/(1 bitShift: 1075)) asFloatD isFinite.
self assert: (3/(1 bitShift: 1075)) negated asFloatD isFinite.