Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
Dear All, I need to do a rounding in java code in units of 100 eg. If a number is 2762.22 then the o/p should be 2700 Please note that this number is stored either in big decimal object or in a string. > Your reply was very helpfull I was afraid something like this was happening, do you know an easy way to round off floats? > > i'm replying to myself after obtaining > > this is not a bug, but how IEEE floating > > excerpt from a helpful respond : > > With float and double values, if you want certain rounding behavior, > > You are operating at the limits of IEEE floating point accuracy. > > As described in the standard: ANSI/IEEE STD 754-1985 (IEEE > > ---- > >
Replies: |
Sponsored Links
|