Task

Show how to use the following math constants and functions in your language   (if not available, note it):

   e   (base of the natural logarithm)
   



π


{\displaystyle \pi }


   square root
   logarithm   (any base allowed)
   exponential   (ex )
   absolute value   (a.k.a. "magnitude")
   floor   (largest integer less than or equal to this number--not the same as truncate or int)
   ceiling   (smallest integer not less than this number--not the same as round up)
   power   (xy )


Related task

   Trigonometric Functions


 
:- object(constants_and_functions).
 
    :- public(show/0).
    show :-
        write('e = '), E is e, write(E), nl,
        write('pi = '), PI is pi, write(PI), nl,
        write('sqrt(2) = '), SQRT is sqrt(2), write(SQRT), nl,
        % only base e logorithm is avaialable as a standard built-in function
        write('log(2) = '), LOG is log(2), write(LOG), nl,
        write('exp(2) = '), EXP is exp(2), write(EXP), nl,
        write('abs(-1) = '), ABS is abs(-1), write(ABS), nl,
        write('floor(-3.4) = '), FLOOR is floor(-3.4), write(FLOOR), nl,
        write('ceiling(-3.4) = '), CEILING is ceiling(-3.4), write(CEILING), nl,
        write('2 ** -3.4 = '), POWER is 2 ** -3.4, write(POWER), nl.
 
:- end_object.
 