English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Why 23.45 is printed as 23.4499999999999993 when it is a double and as 23.450000762939453125 when it is a float.

2007-02-16 16:18:40 · 4 answers · asked by Sid S 1 in Science & Mathematics Engineering

4 answers

Depends on your compiler.

2007-02-16 17:22:31 · answer #1 · answered by Anonymous · 0 0

Depends on the computer, the language, and even the particular compiler that produced the math. The bit length for "double" and "float" will depend on all the foregoing. And, just from an hard-nose engineering point of view, if you start with 23.45, extra digits are just fooling you. You only started with four digits of precision and you are stuck with it. More plainly, when you say "23.45" you are asserting that it is not 23.46 or 23.44. You imply that your known accuracy is +/- 1/2 of the value of the next character, so it is 23.45+/-0.005. One of the evils that crept under the tent with the digitization of the mathematics world is that is easy to get hugely long numbers, easy to keep them, and unfortunately, easy to believe that all those extra digits mean something. Test question: what is the correct value for x if x=5/3. If you answered anything like 1.66....7 go back for remedial work.

2007-02-16 20:02:47 · answer #2 · answered by ZORCH 6 · 0 0

poo that floats usually has incredibly bigger quantities of fat in it. this would be widely used. yet on occasion if the fat is a lot it must be by way of an underlying pathology/ailment best to malabsorption (the place ur physique cant take up the fat that u devour) e.g. on occasion in bacterial/viral diahrreas. Fatty poo is often greater pungent than widely used stool (thats to help u differentiate if its fatty or no longer). Fatty poo is likewise confusing to flush. So in my suggestion to u is: if its too lots and u think of its incredibly undesirable, bypass see a doctor. and if u have this ingredient on occasion..then its no massive deal

2016-11-23 14:24:20 · answer #3 · answered by capallia 4 · 0 0

good question, I always wondered that, but normally we just use double format

2007-02-16 16:26:58 · answer #4 · answered by Ri 3 · 0 0

fedest.com, questions and answers