Boost logo

Boost :

From: Noah Stein (noah_at_[hidden])
Date: 2001-10-24 13:26:46


> I don't really see what's wrong with the simple
>
> namespace math
> {
> double const pi = 3.14159265358...;
> }

For me, it's an enormous burden. I work on hardware that only supports
floats. I'd have to cast the constants every time I use them. Should I
forget, I get stuck with a software implementation of double-precision math,
which is something I don't ever want to accidentally do, especially in the
middle of a tight loop.

In addition to floats, though, I also used fixed point formats frequently,
so a system that supports multiple type defintions for constants is a great
thing. I'd have almost no option but to use a runtime conversion for a
double constant to a fixed-point. Maybe I'm being selfish, but I like the
other way. :)

-- Noah


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