[Info-vax] VMS Software Q1 '23 Update
Johnny Billquist
bqt at softjar.se
Mon Jan 30 19:30:37 EST 2023
On 2023-01-29 01:25, Arne Vajhøj wrote:
> I am not sure that I get your point.
>
> This is how rounding of money works.
>
> Software that operate on money needs to implement
> the rules.
>
> Same reason that good rounding supports different
> rounding mode: UP (round .5 up), EVEN (round .5 to
> even) etc.. Different places has different rules and
> the software need to implement those.
I think it's very important to differentiate between comparison between
two floating point numbers for equality, and the question if two
monetary amounts would round to the same value.
These are two different things.
For the latter, I would first perform the correct rounding for both
values, and then again do a comparison between the two resulting values,
which if stored as floating point, needs to be close enough to each
other to be considered equal.
Johnny
More information about the Info-vax
mailing list