Numerics question: reading floating point constants

Howard Stearns hstearns at wisc.edu
Sun Apr 9 21:05:46 UTC 2006


There's the classic dragon algorithm in Steele & White:
http://portal.acm.org/citation.cfm? 
id=93559&coll=portal&dl=ACM&CFID=12707099&CFTOKEN=91916204
This is the flip-side of Clinger.

Note that conforming ANSI Common Lisp implementations are required to  
comply correctly when the programmer requests that numbers be bit  
identical after being round-tripped though PRINT and READ.  As far as  
I know, everyone just uses the same old code for this, which is  
available in open-source Lisps.

On Apr 9, 2006, at 11:23 AM, stéphane ducasse wrote:

> Do you know a good book or lectures on the problems related to  
> number representation in our nice
> computers?
>
> Stef
>
> On 9 avr. 06, at 18:18, nicolas cellier wrote:
>
>> 1 point for Andres, conversion from base 10 to base 2 is inexact.
>>
>> 1 point for Boris : successive inexact operations are not only  
>> costly, they
>> can degrade accuracy.
>>
>> I wonder if the conversion shouldn't be made with respect to IEEE  
>> rounding
>> mode, and if i remember, this rounding mode is a parameter of  
>> underlying
>> hardware.
>>
>> In the past, i tried several algo. and finally, i lazily decided  
>> to use a call
>> to sprintf/sscan from within VW.
>> But with a good reference such as Tony's (1 point) we should make  
>> it in
>> Smalltalk.
>>
>> Nicolas
>>
>>
>
>




More information about the Squeak-dev mailing list