List:General Discussion« Previous MessageNext Message »
From:Chris W Date:November 18 2006 8:21am
Subject:Re: float numbers
View as plain text  
Dan Nelson wrote:
> Since base-10 fractions can't be represented exactly by a base-2
> floating-point number, any fractional value you store will be
> imprecisely stored and will cuase rounding errors. 
>   
That isn't "exactly" true.  If you were to add the word "always" between 
can't and be, it would have been true. 

There are some base 10 fractions that can't be expressed exactly in base 
2, and some base 2 fractions that can't be expressed exactly in base 
10.  However, there are also fractions that can be stored exactly in 
both base 10 and base 2, such as .5, .25, .125, .75, .625.  You get the 
idea.  I don't remember any examples of the first two cases, and am too 
lazy to figure any out, but they do exist.




-- 
Chris W
KE5GIX

"Protect your digital freedom and privacy, eliminate DRM, 
learn more at http://www.defectivebydesign.org/what_is_drm"

Gift Giving Made Easy
Get the gifts you want & 
give the gifts they want
One stop wish list for any gift, 
from anywhere, for any occasion!
http://thewishzone.com

Thread
float numbersAhmad Al-Twaijiry17 Nov
  • Re: float numbersDan Nelson17 Nov
    • Re: float numbersChris W18 Nov
  • Re: float numbersmos17 Nov
    • Re: float numbersAhmad Al-Twaijiry17 Nov
      • Re: float numbersDan Nelson17 Nov
      • Re: float numbersAsif Lodhi19 Nov
        • Re: float numbersAhmad Al-Twaijiry20 Nov
      • RE: float numbersJerry Schwartz20 Nov
  • ANN: SQL Maestro 6.12 releasedSQL Maestro Group14 Dec