On my current project we are getting slammed by rounding errors from using floats. look at this code:
double x = 426.39 + 834.20;
System.out.println("x: " + x);
Surprisingly it prints:
x: 1260.5900000000001
Friday, August 22, 2003
Don't use floats for money fields
Labels:
programming
Subscribe to:
Comment Feed (RSS)
|