Boost logo

Boost :

From: Gabriel Dos Reis (Gabriel.Dos-Reis_at_[hidden])
Date: 2000-10-20 11:52:39

"David Abrahams" <abrahams_at_[hidden]> writes:


| > Even if the user-defined floating point type has denorm_absent, what
| > do you think min() should be?
| The standard says:
| numeric_limits members
| static T min() throw();
| 1 Minimum finite value. 181)
| 2 For floating types with denormalization, returns the minimum positive
| normalized value.
| 3 Meaningful for all specializations in which is_bounded != false, or
| is_bounded == false
| && is_signed == false.
| Clearly, unless the type is a floating type with denormalization, min()
| should return the "Minimum finite value".

The keyword is "user-defined". No, I'm not quibbling.
If we have to stick to standard texts (as you rightly pointed out)
then a user-defined floating point type can't be anything but a
class-type. On the other hand, the C++ Standard text defines precisely
what it means by a floating point type:

  There are three /floating point types/: float, double, and long
  double. [...]

Thus in that regard I don't think there is a defect, because the
standard knows nothing about "user-defined floating point type".

That said, we have to get pratical -- that is to leave for a moment
the ideal world of standards. I can understand a "user-defined
floating point type" as being a class-type designed to provide
floating point types in the sense of LIA. Since the C++ standard
doesn't say anything about such beings (that is not a defect, because
the standard can't reasonably talk about something it knows nothing
about) you get what the designer give you.

-- Gaby

Boost list run by bdawes at, gregod at, cpdaniel at, john at