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

Re: reading a float?





Bruce Hoult wrote:
> 
> 1) punt and do whatever the C library on the given platform does

It's been implied that this may be somewhat limited and not cover all
formats? If so, I would think the answer is obvious: Dylan code to
reduce the input string to a canonical representation, followed by C
library conversion.

I'm not sure what gives here; I've worked with other libraries where the
string class included conversion to/from ints using the C libraries, but
did not do so for floats even though there was a routine in the C
libraries. Whether or not the C routines were complete wrt to the output
formats of a float, they worked for the simple cases I threw at them.

> 4) do platform-specific bit-twiddling.

Argh. I had to do this once for converting binary representations. Some
cases are easy; some are gnarly.



Follow-Ups: References: