[Prev][Next][Index][Thread]

Re: reading a float?



In article <brucehoult-2104000026580001@bruce.bgh>, 
brucehoult@pobox.com (Bruce Hoult) wrote:

> 1) punt and do whatever the C library on the given platform does

[...]

> It's hard to see how you can go past 1).  Doing this properly is actually
> far harder than I've intimated above -- people actually write academic
> papers on the subject.  Someone's already done the hard work of getting
> fast, accurate FP conversions to work on any machine that has a C
> compiler.    Why not use it?

Because they probably haven't done a very good job of making it accurate.

It's common for 3d modelling programs to store models as lists of ASCII
floating point numbers.  Often, loading a model and saving it again
results in a different set of numbers, whether or not anything was
actually changed.  This strongly suggests that there are commercial C
compiler/library combinations where converting float -> string -> float
is not even idempotent, let alone an identity.

It _is_ possible to do it right.  My suggestion would be to take one of
those academic papers and convert the CL code presented there to Dylan.

Sean Case

-- 
Sean Case                  gsc@zipworld.com.au

Code is an illusion.  Only assertions are real.



Follow-Ups: References: