www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/29/06:42:14

Date: Fri, 29 Nov 1996 14:26:38 +0300 (MSK)
From: "Alexander V. Lukyanov" <lav AT video DOT yars DOT free DOT net>
Message-Id: <199611291126.OAA25240@video.yars.free.net>
To: afonso AT inesca DOT inesca DOT pt, djgpp AT delorie DOT com
Subject: Re: Problems with DJGPP V2.01 - atof() function

>         I've got result = 112!!! not 113 as I wished, because
> the function atof() return is 1.29999... not 1.13 (and I only have
> an old i386).
>         I think that problem is a bug of DJGPP Library V2.xx.

It is not a bug in library. It is a general limitation of
floating pointer numbers in base 2. The number 1.13 written in binary
notation is a periodic number and can't be expressed precicely
in types float or double.

In general, you can't trust floating numbers in being precice,
there is almost always an error.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019