Weird arithmetic

P

Pascal Gallois

In the long run, however, you can easily cause yourself and your colleagues
a lot of grief by ignoring the distinction between decimal and binary
arithmetic.

This is more an issue with excess precision and certainly x86 related. And
it also has to do with GCC insofar as even if you cast the value of
an expression involving excess precision to double which should get rid of
excess bits, it still goes wrong (against the standard (6.3.1.8 and
footnote 52)).

A possible solution would also be to use long double: long double m =
200.45L; The trailing L causes proper initialization of extended
precision bits.

- Pascal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
474,164
Messages
2,570,898
Members
47,439
Latest member
shasuze

Latest Threads

Top