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


show mexp(256);   % outputs e; since MF uses mexp(x) = exp(x/256)
show 3.14159;     % no pi constant built in; of course we can define it
                  % in several ways... even computing
                  % C/2r (which would be funny since MF handles paths,
                  % and a circle is a path...)
show sqrt2;       % 1.41422, or in general sqrt(a)
show mexp(256*x); % see e.
show abs(x);      % returns |x| (the absolute value of the number x, or
                  % the length of the vector x); it is the same as
                  % length(x); plain Metafont in fact says:
                  % let abs = length;
show floor(x);    % floor
show ceiling(x);  % ceiling
show x**y;        % ** is not a built in: it is defined in the basic macros
                  % set for Metafont (plain Metafont) as a primarydef