Boost logo

Boost :

From: Reece Dunn (msclrhd_at_[hidden])
Date: 2003-06-18 14:23:24

Gennaro Prota wrote:

>In fact it's not a matter of speed, but of precision. I'm sure there
>are compilers where the -sin(pi/2.) in the example code is faster than
>-sin(pi/two ). However an overload allows you to specify that the
>value of, say, arccos(-1) [math::acos(minus_one)] is exactly pi.

Also, using constructs like this is easier for the programmer. You don't
have to search to see if there is a pi/2 constant and find out what it is
called, you simply use:
   boost::pi / boost::two
or whatever. This also makes it easier to read, rather than

What about 2/pi:
   2_pi // illegal
   _2_pi or two_pi // counter intuitive

Using overloads makes it easier to extend this set in a clean, consistent


Use MSN Messenger to send music and pics to your friends

Boost list run by bdawes at, gregod at, cpdaniel at, john at