View Single Post
Old Jun 23rd, 2005, 10:33 PM   #6
clearbit
Newbie
 
clearbit's Avatar
 
Join Date: Jun 2005
Location: far..far..away
Posts: 25
Rep Power: 0 clearbit is on a distinguished road
Quote:
Originally Posted by DaWei
Your post was misleading; if this is what you thought the output should be, you would be wrong.

labs (at least my labs) would not return a fractional decimal value.

When your user provides input, he/she provides keystrokes. "2.3" has to be converted from keystroke codes to some number. If it's converted to some floating point value such as a double or long double it will become some value which may not be precisely 2.3. Floating point gains range at the expense of precision. Many "rounding" operations (not all) are merely output formatting operations. How an integer or float is handled is in the hands of your implementation and compiler. 'Native" sizes vary.
yeah sorry, the ouput was just something i made up ont the top of my head, i haven't coded the actual program yet, but i see what you are saying thnx
clearbit is offline   Reply With Quote