comp.lang.ada
 help / color / mirror / Atom feed
From: "Jean-Pierre Rosen" <rosen@adalog.fr>
Subject: Re: ADA.CALENDAR and midnight
Date: Thu, 5 Aug 2004 14:15:56 +0200
Date: 2004-08-05T14:15:56+02:00	[thread overview]
Message-ID: <ae8tec.1ud.ln@skymaster> (raw)
In-Reply-To: 2nelqrF21jaU1@uni-berlin.de

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 763 bytes --]


"Jano" <notelacreas@porfavor.no> a �crit dans le message de news:2nelqrF21jaU1@uni-berlin.de...
> Brian May wrote:
>
> > [2] Can someone confirm my assumption that Integer(86_399.9) = 86_399?
>
> Conversion between decimal and integer types does rounding. At least in
> gnat.
4.6 (32):
If the target type is an integer type and the operand type is real, the result is rounded to the nearest integer (away from zero if
exactly halfway between two integers).

If you want truncation, either subtract 0.5 or use the 'Floor attribute (or 'Truncation, depending on the behaviour you want for
negative values).

-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr





  reply	other threads:[~2004-08-05 12:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-05 10:00 ADA.CALENDAR and midnight Brian May
2004-08-05 11:06 ` Frank Piron
2004-08-05 11:19 ` Nick Roberts
2004-08-05 11:46   ` Brian May
2004-08-05 12:01     ` Jano
2004-08-05 12:15       ` Jean-Pierre Rosen [this message]
2004-08-05 23:18         ` Brian May
2004-08-06  5:59           ` Martin Dowie
2004-08-06  7:34           ` Gautier
2004-08-05 13:01 ` Ada.Calendar " Jacob Sparre Andersen
replies disabled

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