Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0006983 [Squeak] Kernel minor always 03-14-08 22:37 04-18-10 22:05
Reporter nicolas cellier View Status public  
Assigned To nicolas cellier
Priority normal Resolution fixed  
Status closed   Product Version 3.10
Summary 0006983: Float nan isLiteral. It should not.
Description There is no way to store Float nan as a literal.
(Yes there is one, but there should not. It is a bug of Number>>readFrom:, see 0006982)

Examples:

self assert: (Compiler evaluate: Float nan storeString) isNan.

self assert: (Compiler evaluate: (Array with: Float nan) storeString) first isNan.
Additional Information I have an easy and cheap way to define isLiteral which is synonym of isFinite:

^(self - self) isZero
Attached Files  FLoat-isLiteral-Test-M6983-nice.1.cs [^] (471 bytes) 03-14-08 22:49
 Float-isLiteral-Patch-M6983-nice.1.cs [^] (789 bytes) 03-14-08 22:50

- Relationships

- Notes
(0011924 - 327 - 351 - 351 - 351 - 351 - 351)
nicolas cellier
03-14-08 22:55

Note that there are still literal representation of Float infinity, like 1.0e1000.

However, since Float infinity is not able to print literaly, and isLiteral is intended for print, i think it's better to answer false for infinite Floats too.

Unless you really like (Array with: Float infinity) to be printed #(1.0e1000) ?
 
(0011926 - 315 - 365 - 365 - 503 - 503 - 503)
nicolas cellier
03-15-08 00:28

Note that the patch does not solve storeString bugs indicated above.
See 0001631 for a possible solution.

(Array with: Float nan) storeString ->
 '((Array new: 1) at: 1 put: NaN; yourself)'

A side effect is that Float nan and Float infinity are no more selfEvaluating...
(which is true until 0001631 is fixed).
 
(0012894 - 179 - 233 - 233 - 233 - 233 - 233)
nicolas cellier
01-04-09 22:34

"fix begin"
Installer mantis bug: 6983 fix:'Float-isLiteral-Patch-M6983-nice.1.cs'.
"fix test"
Installer mantis bug: 6983 fix:'FLoat-isLiteral-Test-M6983-nice.1.cs'.
"fix end"
 
(0013283 - 59 - 59 - 209 - 209 - 209 - 209)
nicolas cellier
08-24-09 20:20

Fixed in http://source.squeak.org/trunk/Kernel-nice.207.mcz [^]
 

- Issue History
Date Modified Username Field Change
03-14-08 22:37 nicolas cellier New Issue
03-14-08 22:49 nicolas cellier File Added: FLoat-isLiteral-Test-M6983-nice.1.cs
03-14-08 22:50 nicolas cellier File Added: Float-isLiteral-Patch-M6983-nice.1.cs
03-14-08 22:55 nicolas cellier Note Added: 0011924
03-15-08 00:28 nicolas cellier Note Added: 0011926
01-04-09 22:34 nicolas cellier Note Added: 0012894
01-10-09 02:13 Keith_Hodges Status new => pending
08-24-09 20:20 nicolas cellier Note Added: 0013283
10-03-09 20:20 nicolas cellier Status pending => resolved
10-03-09 20:20 nicolas cellier Fixed in Version  => trunk
10-03-09 20:20 nicolas cellier Resolution open => fixed
10-03-09 20:20 nicolas cellier Assigned To  => nicolas cellier
04-18-10 22:05 andreas Status resolved => closed


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
57 total queries executed.
40 unique queries executed.
Powered by Mantis Bugtracker