comp.lang.ada
 help / color / mirror / Atom feed
From: Frank Piron <empty@zero.nil>
Subject: Re: ADA.CALENDAR and midnight
Date: Thu, 05 Aug 2004 13:06:15 +0200
Date: 2004-08-05T13:06:15+02:00	[thread overview]
Message-ID: <opsb9agpolm0et4w@news.online.de> (raw)
In-Reply-To: sa4acx9ewff.fsf@snoopy.apana.org.au

Hi,

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

> Hello,
>
> 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)?

Any instance of type DAY_DURATION represents a timespan.
"midnight" means a point in time (more precisely a discrite,
infinite subset of all points in time).

If you would take away 86_400.0 from DAY_DURATION then you would
have a unique representation for every point in time p as:

p = midnight + dd (dd a DAY_DURATION instance)

on the one hand. But on the other hand the timespan of a full day
could not be represented by an instance of DAY_DURATION.

-- 
Crisis? What Crisis?
----------------------------------------------------
f_r_a_n_k_a_t_k_o_n_a_d_d_o_t_n_e_t



  reply	other threads:[~2004-08-05 11:06 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 [this message]
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
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