Stream: general

Topic: 999...9.0 - 999...8.0


csmoe (Jan 06 2019 at 08:19, on Zulip):

how to get the correct result in rust(from an interesting HN thread?

fn main() {
    let x = 9999999999999999.0 - 9999999999999998.0;
    assert_eq!(1.0, x);
}

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=397cf6ad371e03c0e816e94a8ed300e3

nagisa (Jan 06 2019 at 08:23, on Zulip):

apfloat

nagisa (Jan 06 2019 at 08:24, on Zulip):

@eddyb now that apfloat is a nice external crate, perhaps releasing a proper apfloat and making the compiler depend on it would be great?

csmoe (Jan 06 2019 at 08:25, on Zulip):

thanks :slight_smile:

Last update: Nov 20 2019 at 11:25UTC