Hi all,
I'm having a look how floats are printed.
Why we check two times if a Float is infinite ?
A first time in:
Float>>printOn: stream base: base
...
self isInfinite
ifTrue: [
stream nextPutAll: 'Float infinity'.
^ self sign = -1 ifTrue: [ stream nextPutAll: ' negated' ] ].
...
and a second time in:
Float>>absPrintExactlyOn: aStream base: base
...
self isInfinite ifTrue: [
aStream nextPutAll: 'Float infinity'.
^ self].
...
the same in Float>>absPrintInexactlyOn: aStream base: base
...
self isInfinite ifTrue: [aStream nextPutAll: 'Float infinity'. ^ self].
...
Apparently the last two methods are never called when number is infinite.
I remove the second checks and apparently nothing breaks (all number tests are still green).
Regards,
--
Int. Research Unit
on Modelling/Simulation of Complex Systems (UMMISCO)
Sorbonne University
(SU)
French National Research Institute for Sustainable Development (IRD)
U
niversity of Yaoundé I, Cameroon