'From Squeak3.10beta of 22 July 2007 [latest update: #7159] on 15 March 2008 at 12:38:26 am'!
"Change Set: Float-readFromManyDigits-Test-M6982-nice
Date: 15 March 2008
Author: nice
This is a non regression test for http://bugs.squeak.org/view.php?id=6982
A naive Float>>readFrom: does interpret numbers with many digits as Infinity or NaN"!
!FloatTest methodsFor: 'testing - conversion' stamp: 'nice 3/14/2008 23:59'!
testReadFromManyDigits
"A naive algorithm may interpret these representations as Infinity or NaN.
This is http://bugs.squeak.org/view.php?id=6982"
| s1 s2 |
s1 := '1' , (String new: 321 withAll: $0) , '.0e-321'.
s2 := '0.' , (String new: 320 withAll: $0) , '1e321'.
self assert: (Number readFrom: s1) = 1.
self assert: (Number readFrom: s2) = 1.! !