Boost logo

Boost :

From: Guillaume Melquiond (guillaume.melquiond_at_[hidden])
Date: 2006-05-16 01:54:12


Le lundi 15 mai 2006 à 22:21 -0700, Jeff Garland a écrit :
> In date_time there's -inf, +inf, and not_a_date_time. There's
> no union internally used to represent them. These values are extremely
> useful for writing real programs and have obvious mappings into the real
> world -- trust me, I've used them in a real world scheduling system. In
> fact, since date_time uses integers internally the special values are
> simply implemented as a reserved number value. nadt is essentially
> max_int, +inf == max_int - 1 and -inf == min_int.

For symmetry purpose, I would have chosen nadt == min_int, +inf =
max_int, -inf = min_int + 1. That way, in usual two-complement
representations, there is as much positive than negative finite values
and infinities have the same absolute representation. Just pointing it
out in case nobody did before.

Best regards,

Guillaume


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk