[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Why not DBL_MAX?

From: Greg Chicares
Subject: [lmi] Why not DBL_MAX?
Date: Sat, 24 Mar 2007 02:09:12 +0000
User-agent: Thunderbird (Windows/20060516)


I agree that adding this function:
    static void ensure_limit_is_maximum(double limit);
makes good sense. But why use this:
    double stratified_entity::limit_maximum = DBL_MAX;
instead of just writing DBL_MAX?

Is there some arcane reason, e.g., that this quantity:
    static double const max_double = std::numeric_limits<double>::max();
in a removed line might not equal DBL_MAX for some woeful
compiler? (Really old versions of MinGW gcc did have an
incorrect value for DBL_EPSILON.)

Is the reason that the value might change someday? If so,
why? So that we could make the algorithms that use it
correct even for infinity? Or so that we could restrict
them to "plausible" values, recognizing that we're really
operating on currency and no one has even 1e37 dollars?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]