A new version of KernelTests was added to project The Inbox:
http://source.squeak.org/inbox/KernelTests-nice.239.mcz==================== Summary ====================
Name: KernelTests-nice.239
Author: nice
Time: 11 December 2012, 11:33:05.962 pm
UUID: 032a152a-f6be-4636-8e3b-6c46779d72c1
Ancestors: KernelTests-nice.238
Tests asserting floorLog: exactness for Number performing exact arithmetic
=============== Diff against KernelTests-nice.238 ===============
Item was added:
+ ----- Method: FractionTest>>testFloorLogExactness (in category 'tests - mathematical functions') -----
+ testFloorLogExactness
+
+ 1 + (Float fminDenormalized floorLog: 10) to: -1 do: [:n |
+ self assert: ((10 raisedTo: n) floorLog: 10) = n].
+
+ "Float version is not exact for at least 2 reasons:
+ 1/(10 raisedTo: n) asFloat is not exact
+ (aFloat log: radix) is not exact
+
+ (1 + (Float fminDenormalized floorLog: 10) to: -1) count: [:n |
+ ((10 raisedTo: n) asFloat floorLog: 10) ~= n]."
+ !
Item was added:
+ ----- Method: IntegerTest>>testFloorLogExactness (in category 'tests - mathematical functions') -----
+ testFloorLogExactness
+
+ 1 to: (Float fmax floorLog: 10) do: [:n |
+ self assert: ((10 raisedTo: n) floorLog: 10) = n].
+
+ "Float version is not exact for at least 2 reasons:
+ (10 raisedTo: n) asFloat is not exact for n > 22
+ (aFloat log: radix) is not exact
+
+ (1 to: (Float fmax floorLog: 10)) count: [:n |
+ ((10 raisedTo: n) asFloat floorLog: 10) ~= n]."!
Item was added:
+ ----- Method: ScaledDecimalTest>>testFloorLogExactness (in category 'tests - mathematical functions') -----
+ testFloorLogExactness
+ 1 + (Float fminDenormalized floorLog: 10) to: (Float fmax floorLog: 10) do: [:n |
+ self assert: ((10 raisedTo: n) asScaledDecimal floorLog: 10) = n description: 'floorLog should be exact for ScaledDecimals'.]!