comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <nick.roberts@acm.org>
Subject: Re: ADA.CALENDAR and midnight
Date: Thu, 05 Aug 2004 12:19:20 +0100
Date: 2004-08-05T12:19:20+01:00	[thread overview]
Message-ID: <opsb9a2igcp4pfvb@bram-2> (raw)
In-Reply-To: sa4acx9ewff.fsf@snoopy.apana.org.au

On Thu, 05 Aug 2004 20:00:52 +1000, Brian May <bam@snoopy.apana.org.au>  
wrote:

> According to documentation I have:
>
> subtype DAY_DURATION is DURATION range 0.0 .. 86_400.0;
>
> How is midnight meant to be represented?
>
> I would have assumed it would be 0.0, the next day, but preliminary
> tests, unless I am confused, seem to show it is represented as
> 86_400.0 (using gnat compiler for Windows)? The following quote from
> the documentation would seem to imply I am correct; "SECONDS
> indicating the number of seconds past midnight", but I am getting
> behaviour which suggests otherwise.
>
> Why are both 0.0 and 86_400.0 defined to be legal values?  Aren't
> they both the same thing (but one day apart)?

RM95 (TC1) 9.6 (25) states:

    If Time_Of is called with a seconds value of 86_400.0, the value
    returned is equal to the value of Time_Of for the next day with a
    seconds value of 0.0. The value returned by the function Seconds or
    through the Seconds parameter of the procedure Split is always less
    than 86_400.0.

So I would say that an implementation which returns 86_400.0 is
faulty.

-- 
Nick Roberts



  parent reply	other threads:[~2004-08-05 11:19 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 [this message]
2004-08-05 11:46   ` Brian May
2004-08-05 12:01     ` Jano
2004-08-05 12:15       ` Jean-Pierre Rosen
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