Hi,

I am trying to have a number and find out the square root for it. 
I have written a code as below...

:- module log_sqrt.
:- interface.
:- import_module io.
:- pred main(io__state, io__state).
:- mode main(di, uo) is det.

:- implementation.
:- import_module math, float.

main -->
         print(" Square root of 9 is \n"),
         math__sqrt(9.00).

I get an error regarding number of arguments like ...
log_sqrt.m:012: In clause for predicate `log_sqrt:main/2':
log_sqrt.m:012:   error: wrong number of arguments (3; should be 
2)
log_sqrt.m:012:   in call to predicate `math:sqrt'.
Plz do help me solve this error.

I have written one more code as below
:- module log_sqrt1.
:- interface.
:- import_module io.
:- pred main(io__state, io__state).
:- mode main(di, uo) is det.

:- implementation.
:- import_module math, float.

main -->
         print(" Square root of 9 is \n"),
         math__sqrt(9.00, Res).
         io__write_float(Res).
The error is not solved here also. Instead it says that there are 
4 arguments whereas there should have been 2.

Pls do help me rectify the error.

Thanks and Regards,

Noel


--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users@cs.mu.oz.au
administrative address: owner-mercury-users@cs.mu.oz.au
unsubscribe: Address: mercury-users-request@cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request@cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------

