[Info-vax] VMS Software Q1 '23 Update

Arne Vajhøj arne at vajhoej.dk
Wed Feb 1 09:11:15 EST 2023


On 2/1/2023 8:17 AM, Simon Clubley wrote:
> 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 ?
> 
> Based on a quick search, the answer would appear to be yes, which was
> a bit of a surprise...

It does but Clippy complains unless you instruct it not to.

#[allow(clippy::float_cmp)]

fn main() {
     let x:f64 = 123.456;
     let y:f64 = 123.456;
     let eq1:bool = x == y;
     println!("{0} = {1} is {2}", x, y, eq1);
}


Arne





More information about the Info-vax mailing list