comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.acm.org>
Subject: Re: Modify value - type duration
Date: Thu, 06 Nov 2008 01:57:39 GMT
Date: 2008-11-06T01:57:39+00:00	[thread overview]
Message-ID: <nasQk.422242$yE1.14213@attbi_s21> (raw)
In-Reply-To: <6f0d9434-9489-4946-b29f-60957c83858c@w1g2000prk.googlegroups.com>

Adam Beneschan wrote:
> 
> Hmmm ... now I wonder why there isn't a Truncation attribute for fixed-
> point types?  Maybe nobody before Andreas ever thought they'd need
> one.  Might be useful.  (Also Floor, Ceiling.)

No, I wondered about that long ago.

> A possible problem with the floating-point conversion solution is that
> there may be cases where you lose accuracy---if, e.g., the largest
> floating-point type and fixed-point systems supported on the machine
> are both 64 bits.  Since a floating-point number needs room for an
> exponent, it's possible to define a fixed-point type with more bits in
> the integer part than can be represented in the mantissa of a floating-
> point type, e.g.

One must always be careful in such cases that the conversion will not fail or 
lose important bits.

-- 
Jeff Carter
"You a big nose have it."
Never Give a Sucker an Even Break
107



  reply	other threads:[~2008-11-06  1:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-05 21:50 Modify value - type duration Andreas.Schmidl
2008-11-05 22:47 ` Jeffrey R. Carter
2008-11-06  1:03   ` Adam Beneschan
2008-11-06  1:57     ` Jeffrey R. Carter [this message]
2008-11-06 21:14       ` Keith Thompson
2008-11-07  1:33       ` Randy Brukardt
2008-11-07 11:10         ` Ludovic Brenta
replies disabled

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