|
Boost : |
From: Daniel Frey (daniel.frey_at_[hidden])
Date: 2004-03-01 05:18:25
Thorsten Ottosen wrote:
> Yes, of course. BTW, I've attached the file since
> my messages seems to format the code like ****.
>
> br
>
> Thorsten
With no offense intended, but that's a very simple version which doesn't
work in many situations. The problems of your solution are:
- Doesn't work well for UDTs (try std::complex, some conversions are
ambiguous then)
- Doesn't scale for new types (you need to know all of them in the
single header that defines the constant)
- Doesn't work for more complex expressions (pi*pi*t instead of T(pi)*pi*t)
- Doesn't work for function calls (srqt(pi)*t instead of sqrt(T(pi))*t)
- Doesn't solve the naming dilemma (how to spell the constant "pi*pi"?)
- Doesn't work well with unit libraries AFAICS (again not scaling well)
I really suggest you look at my code at
<http://groups.yahoo.com/group/boost/files/MathConstants/>, which solves
all of the above points. Feel free to ask questions.
Regards, Daniel
-- Daniel Frey aixigo AG - financial solutions & technology Schloß-Rahe-Straße 15, 52072 Aachen, Germany fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99 eMail: daniel.frey_at_[hidden], web: http://www.aixigo.de
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk