Anonymous | Login | 03-01-2021 19:15 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | |||||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | |||||||
0003493 | [Squeak] Kernel | minor | always | 04-21-06 22:48 | 01-08-13 21:44 | |||||||
Reporter | nicolas cellier | View Status | public | |||||||||
Assigned To | ||||||||||||
Priority | normal | Resolution | open | |||||||||
Status | new | Product Version | 3.9 | |||||||||
Summary | 0003493: printing a float in base 16 is broken sometimes | |||||||||||
Description |
See this example: "this should be the maximum floating point value in IEEE 754 double precision" (Number readFrom: ((String new: 100) writeStream nextPutAll: '2r1.'; next: 52 put: $1; nextPutAll: 'e1023'; contents)) printStringBase: 16. "will print as 16r1.0e255" (Number readFrom: ((String new: 100) writeStream nextPutAll: '2r1.'; next: 52 put: $1; nextPutAll: 'e1020'; contents)) printStringBase: 16. "will print as 16r2.0e255, twice the first number when it should be 1/8..." |
|||||||||||
Additional Information |
Well, in base (2 raisedTo: Integer anyPositive), printString should be exact... First number is exactly 16rF.FFFFFFFFFFFF8e255 and last is exactly 16r1.FFFFFFFFFFFFFe255 if exponent is written in base 10, or same mantissa with exponent eFF in base 16... Note that absPrintExactlyOn:base: will give correct answer. Rounding should better not be used, because printed number would answer Infinity when read back... But if it where used correctly, then the answers would be: 16r1.0e256 and 16r2.0e255 |
|||||||||||
Attached Files |
![]() ![]() ![]() ![]() |
|||||||||||
|
![]() |
|||||||||||
|
Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
63 total queries executed. 39 unique queries executed. |