comp.lang.ada
 help / color / mirror / Atom feed
From: Peter Hermann <ica2ph@iris16.csv.ica.uni-stuttgart.de>
Subject: Re: precision
Date: Thu, 20 Feb 2003 10:27:19 +0000 (UTC)
Date: 2003-02-20T10:27:19+00:00	[thread overview]
Message-ID: <b32ai7$8bb$1@news.uni-stuttgart.de> (raw)
In-Reply-To: mailman.25.1045734204.9948.comp.lang.ada@ada.eu.org

>> What is precision of float means?
>> My understanding is that if precision is 6 digits then 1.0 and
>> 1.0000001 are same!!! Please let me know whether my understanding is
   1 23456 = decimal position
>> right.If not then what it means?
> Approximately. For exact information, see RM 3.5.7.

and more (-:
The compiler is required to map the mantissa to AT LEAST 10 decimal 
digits, which means for binary representation a binary mantissa
of at least 6/lg2 = 6/0.301... = 19.93... giving AT LEAST 
20 binary digits.
However the chosen mantissa length depends very much on the implementation.
On 32bit floating point you may have a 23 or 24 bit mantissa where as
on a 60 or 64 bit smallest floating point (e.g. CDC, Cray)
your smallest mantissa has 48 bits.
In this case 1.0 and 1.0000001 will be "different" :-)

-- 
--Peter Hermann(49)0711-685-3611 fax3758 ica2ph@csv.ica.uni-stuttgart.de
--Pfaffenwaldring 27 Raum 114, D-70569 Stuttgart Uni Computeranwendungen
--http://www.csv.ica.uni-stuttgart.de/homes/ph/
--Team Ada: "C'mon people let the world begin" (Paul McCartney)



  reply	other threads:[~2003-02-20 10:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-20  9:35 precision Grein, Christoph
2003-02-20 10:27 ` Peter Hermann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-02-20  8:50 precision prashna
2003-02-23 12:50 ` precision Martin Krischik
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox