[mercury-users] Math Module

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Oct 20 00:38:14 AEST 2002


On 19-Oct-2002, Noel  Pinto <cool4life at rediffmail.com> wrote:
> 1) I want to know more of Mathematical Constants. There are two 
> constants, one for Pythagorus and Natural Algorithms.

It's natural *logarithms*, not *algorithms*.

> Plz do explain how do I implement them?

You don't.  We, the Mercury implementors, implement them.

If you are asking how you might *use* these values...
did you do any mathematics at school? 
If not, then I suggest you do not try to use these values!

If you a moderate amount of maths at school, then you should
know that "e" and "pi" are well-known mathematical constants
which appear in common formulae.  For example, pythagorus's number
"pi" can be used for calculating the circumference or area of a circle,
given its radius.

	:- func area(float) = float.
	area(Radius) = math__pi * Radius * Radius.

	:- func circumference(float) = float.
	circumference(Radius) = 2.0 * math__pi * Radius.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list