Floating point arithmetic, again [Software]

posted by Ohlbe – France, 2020-12-10 21:18 (1289 d 03:37 ago) – Posting: # 22129
Views: 9,632

Hi ElMaestro,

❝ But things are tricky for a figure like 0.1 (one tenth) - in binary you'd probably represent it as .00011001100110011001100110011001100110011001100110011... where the 0011 blocks repeat indefinitely.

❝ In computers are data types have a maximum storage space, like 4 bytes or 8 bytes. So somewhere along the repeating 0011 blocks the computer will truncate the figure so it fits in the memory. And that is the source of your rounding issue.


Mmmm. But then if the problem comes from the nasty 0.1, how comes that if I type =(0.8-0.4-0.2-0.1-0.1) I get a nice 0, without any funky E-17 ? And then if I type =0=(0.8-0.4-0.2-0.1-0.1), or =0=0.8-0.4-0.2-0.1-0.1 I get a nice TRUE ?

Regards
Ohlbe

Complete thread:

UA Flag
Activity
 Admin contact
23,059 posts in 4,841 threads, 1,662 registered users;
38 visitors (0 registered, 38 guests [including 7 identified bots]).
Forum time: 01:56 CEST (Europe/Vienna)

[…] an inappropriate study design is incapable of answering
a research question, no matter how careful the subsequent
methodology, conduct, analysis, and interpretation:
Flawless execution of a flawed design achieves nothing worthwhile.    J. Rick Turner

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5