lmi
[Top][All Lists]
Advanced

[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 1.5.0.4 (Windows/20060516)

20070316T1310Z_DBL_MAX_to_static_limit_maximum.patch

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]