Menu

#1910 float multiply towards zero fails

closed-fixed
5
2013-05-25
2012-01-17
No

When multiplying a float with 0.8 again and again the value does not result in zero, but overflows into something big. E.g.

float mult(float x) { return x * 0.8); }

ASSERT ( mult (1e-38) < 1.0); // fails

This happens for mcs51, but I haven't tested others yet.

Discussion

  • Maarten Brock

    Maarten Brock - 2012-01-18

    Fixed in SDCC 3.1.2 [r7237].

     

    Last edit: Maarten Brock 2021-03-20
  • Maarten Brock

    Maarten Brock - 2012-01-18
    • labels: --> mcs51(8051) target
    • milestone: --> fixed
    • assigned_to: nobody --> maartenbrock
    • status: open --> closed-fixed
     

Log in to post a comment.