Re: amber-developers: ptraj precision

From: Robert Duke <rduke.email.unc.edu>
Date: Mon, 5 Feb 2007 18:58:35 -0500

One additional point. The ia32 chips use a binary exponent/mantissa format,
IEEE 754, so this assures that even simple things like 0.1 are not
represented exactly internally. There is another floating point ieee
standard that does allow for a base 10 exponent, but I don't know if it is
very often used. My standard doc on all this good stuff is a review by
Goldberg - ACM Computing Surveys 23, 1 (1991). I have it in electronic
format if anyone wants it. It is entitled "What Every Computer Scientist
Should Know about Floating-Point Arithmetic" and is great reading for all
bit-heads.
Regards - Bob

----- Original Message -----
From: "Thomas Cheatham III" <tec3.utah.edu>
To: <amber-developers.scripps.edu>
Sent: Monday, February 05, 2007 5:37 PM
Subject: Re: amber-developers: ptraj precision


>
>> EXAMPLE
>> input trajectory file:
>> 18.438 29.157 33.019 18.614 28.133 32.690
>> output restart from ptraj:
>> 18.4379997 29.1569996 33.0190010 18.6140003 28.1329994 32.6899986
>
> As a follow-up to this, Scott or Ross or Bob do you know about IEEE
> conversions and all that hidden magic that likely causes this, i.e. is
> there a compiler option to prevent it?
>
> Basic code is sscanf(buffer, "%f", &value). Note that this could all be
> mute if I get off my butt and fix the character overflow problem (where
> numbers merge into others in trajectories and choke ptraj) with the atof()
> fix, as atof() may not do this magic conversion...
>
> Regardless, do any of you "C" guru's know about this precision adaption
> and conversion of a sensible xxx.123 value into xxx.12299997 value?
>
> --tom
>
>
>
>
Received on Wed Feb 07 2007 - 06:07:26 PST
Custom Search