At 11:57 +0100 1999/02/03, Lennart Augustsson wrote:
>> Or using pi = 2 * asin(1.0). Perhaps likelier to give an accurate value.
>Or why not
> pi = 3.141592653589793238
>(or more decimals if you care)
If you put it into the C-code, the compiler may not read it (for example,
the one I use); if you put it in the Prelude, I think Hugs has its own
parsing, so it will work (but then it probably takes longer time to parse
it than compute it by a C-expression such as 2 * asin(1.0)).
Other than that, it makes no difference whether the decimals are written
out or an algebraic expression is used. But an algebraic expression such as
2 * asin(1.0) has the advantages that it is easier for humans to read, the
time added to the startup is negligable, and the accuracy is likely to be
on the spot these days. So why not use it?
Hans Aberg
* Email: Hans Aberg <mailto:[EMAIL PROTECTED]>
* Home Page: <http://www.matematik.su.se/~haberg/>
* AMS member listing: <http://www.ams.org/cml/>