On Tue, Aug 17, 2010 at 01:54:55AM +0100, Mike Capp wrote:
> "The Rust type float is a machine-specific type equal to one of the
> supported Rust floating-
> point machine types (f32 or f64). It is the largest floating-point
> type that is directly
> supported by hardware on the target machine [...]"

> I'm assuming that the second sentence restricts "floating point types"
> to mean f32 and f64 only, but this seems like a shame. Loss of numeric
> precision with no corresponding gain is going to hurt some potential
> users; see for example William Kahan's classic paper,
> http://www.eecs.berkeley.edu/~wkahan/JAVAhurt.pdf

> "The Rust type float is a machine-specific type. It is the largest
> floating-point type (supported by the compiler) that is directly
> supported by hardware on the target machine [...]"

> That would leave the door open for extended-precision (or even
> quad-precision some day, if and when hardware appears) without forcing
> it now when you have better things to do.

> Would anything else in the spec break if float was not guaranteed to
> be one of f32 or f64?

It wouldn't be nice if 'float' could sometimes be a type that couldn't
be explicitly and portably mandated, so perhaps the solution is to
reserve f80, f96, f128, and so on.  Even so, 'float' would probably
still be f64 on any machine with a 64 bit fp unit regardless of
availability of something like f80.  It might take a while to add
software implementations of the bigger types, but reserving the
keywords now looks the right step.


    Jeff Schultz


_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to