[Pkg] The Trunk: KernelTests-nice.207.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Oct 29 09:39:27 UTC 2011


Nicolas Cellier uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-nice.207.mcz

==================== Summary ====================

Name: KernelTests-nice.207
Author: nice
Time: 29 October 2011, 11:39:06.749 am
UUID: ef2c95d0-2f77-47da-b2de-f232b4043dec
Ancestors: KernelTests-nice.206

Additional test from Juan for nthRoot: an Integer with inexact nthRoot could answer a better Float than infinity.

=============== Diff against KernelTests-nice.206 ===============

Item was added:
+ ----- Method: IntegerTest>>testBigReceiverInexactNthRoot (in category 'tests - mathematical functions') -----
+ testBigReceiverInexactNthRoot
+ 	"
+ 	IntegerTest new testBigReceiverInexactNthRoot
+ 	"
+ 
+ 	"Inexact 3rd root (not a whole cube number), so a Float must be answered.
+ 	However, receiver is too big for Float arithmethic."
+ 	| bigNum result |
+ 	bigNum := (100 factorial raisedTo: 3) + 1.		"Add 1 so it is not a whole cube"
+ 	self assert: bigNum asFloat isInfinite.			"Otherwise, we chose a bad sample"
+ 	result := bigNum nthRoot: 3.
+ 	self assert: result class == Float.
+ 	self deny: result isInfinite.
+ 	self assert: result = 100 factorial asFloat.		"No other float is closer. See following line"
+ 	self assert: 100 factorial asFloat = (100 factorial+1) asFloat!



More information about the Packages mailing list