[Info-vax] Floating Point, Machine Epsilon, Rust, Swift, Etc (was: Re: VMS Software Q1 '23 Update)
Stephen Hoffman
seaohveh at hoffmanlabs.invalid
Wed Feb 1 11:52:35 EST 2023
On 2023-02-01 13:17:06 +0000, Simon Clubley said:
> Something just occurred to me while writing this: does the latest
> solution to everything :-) (ie: Rust) still allow you to directly
> compare two floating point numbers ?
Rust crates:
https://docs.rs/float-cmp/latest/float_cmp/
https://docs.rs/efloat/latest/efloat/
Swift has a deliberately-obscurely-named equivalent to machine epsilon,
as do some other languages.
https://en.wikipedia.org/wiki/Machine_epsilon
Unfortunately, stuff that's labeled "epsilon" is all too often not what
you want to use.
And (more general, not specific to Rust) background on floating point:
https://randomascii.wordpress.com/category/floating-point/
https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
(part of a longer series)
The last OpenVMS port had a fairly long write-up on floating point, and
the x86-64 probably has an update to same, as floating point is always
"fun".
--
Pure Personal Opinion | HoffmanLabs LLC
More information about the Info-vax
mailing list