Re: OT: Re: code for fun

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Floor Terra
Date: Sunday, July 18, 2010 - 6:46 am

On Sun, Jul 18, 2010 at 2:32 PM, Aaron Lewis <aaron.lewis1989@gmail.com>
wrote:
wrote:

Yes. 12.340 has five significant digits. If you want to store it with
just two significant digits you get 12.


The maximum number you can store in a IEEE double is +infinity of course.

A 64 bit double has 52-bit mantissa, together with 1 sign bit it gives
you almost 16 decimal significant digits.
But like other things in life: It's not the size that maters, it's how
you use it. (see math(3) and look for ULP)


Be careful converting  your number to decimal if you want to keep
maximum precision.


--
Floor Terra <floort@gmail.com>
www: http://brobding.mine.nu/
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
code for fun, Aaron Lewis, (Sun Jul 18, 3:27 am)
Re: code for fun, Firas Kraiem, (Sun Jul 18, 3:56 am)
OT: Re: code for fun, Aaron Lewis, (Sun Jul 18, 4:07 am)
Re: OT: Re: code for fun, Floor Terra, (Sun Jul 18, 5:04 am)
Re: OT: Re: code for fun, Firas Kraiem, (Sun Jul 18, 5:15 am)
Re: OT: Re: code for fun, Aaron Lewis, (Sun Jul 18, 5:32 am)
Re: OT: Re: code for fun, Floor Terra, (Sun Jul 18, 6:46 am)