News for hackers. Stuff that matters.
Re:0.30000000000000004 by umanwizard on Monday December 02, 2019 @09:10PM (#21689311)
You can get a larger error than that using one operation.

  fn main() {
      let x: f64 = 9007199254740992.0;
      assert_eq!(x + 1.0, x);
  }
Re:0.30000000000000004 by piadodjanho on Monday December 02, 2019 @09:44PM (#21689455)
You are absolutely right.

When adding numbers with large magnitudes differences (around 10^17 I think) it might exceed the format precision. I should have taken that in account when defining the error boundaries.

In dollars, you start having issues with cents when working with a tens of trillions.

For the vast majority of people this won't be an issue.