Boost logo

Boost :

From: Victor A. Wagner, Jr. (vawjr_at_[hidden])
Date: 2002-09-27 00:38:38


At Thursday 2002/09/26 21:28, you wrote:
>Hi everyone,
>
>Not too long ago, I asked people on this list if anyone was interested in
>having math & physics values incorporated into Boost. Some people
>sounded interested, so here's what I'm proposing:
>
>template <class value_type>
>struct math_vals
>{
> static value_type pi()
> { return value_type(3.14); } // I'll use more digits
> static value_type e()
> { return value_type(2.72); }
> // more math values
>};
>
>Something like that. I'll get the actual values from a reliable
>reference and use as many digits as possible. I figure this is pretty
>simple, efficient, & portable. Maybe if someone thinks this is a little
>verbose, he/she could do something like this in user code:
> const float e = math_vals<float>::e();
>
>I could also do the same thing with physics-related values, like speed of
>light, Planck's constant, & more. However, those all have units, so
>their values depend on what system we're using. Would we want to just
>stick with SI units? Or might we want to have another struct for cgs
>(esu) units? Or would we want to have a units class that acts something
>like a policy?
>
>Does anyone have any thoughts on the general design I've proposed above
>or anything else?

if you're going to play with physics stuff, have you given any thought to
doing Barton & Nackman's templated approach to tracking m, l, and t? It
was mentioned in Scott Meyers forward to Andrei Alexandrescu's book.

Should that be attempted, then we could (of course) include the measurement
system (and possibly even convert automagically between them).

That has been a 'dream' of mine ever since I first saw "object oriented"

>Jason Schmidt
>
>________________________________________________________________
>GET INTERNET ACCESS FROM JUNO!
>Juno offers FREE or PREMIUM Internet access for less!
>Join Juno today! For your FREE software, visit:
>http://dl.www.juno.com/get/web/.
>_______________________________________________
>Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Victor A. Wagner Jr. http://rudbek.com
PGP RSA fingerprint = 4D20 EBF6 0101 B069 3817 8DBF C846 E47A
PGP D-H fingerprint = 98BC 65E3 1A19 43EC 3908 65B9 F755 E6F4 63BB 9D93
The five most dangerous words in the English language:
               "There oughta be a law"


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