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


INCLUDE "H6:REALMATH.ACT"
 
PROC Euler(REAL POINTER e)
  REAL x
 
  IntToReal(1,x)
  Exp(x,e)
RETURN
 
PROC Main()
  REAL a,b,c
  INT i
 
  Put(125) PutE() ;clear screen
  MathInit()
 
  Euler(a)
  Print("e=") PrintR(a)
  PrintE(" by Exp(1)")
 
  ValR("2",a)
  Sqrt(a,b)
  Print("Sqrt(") PrintR(a)
  Print(")=") PrintR(b)
  Print(" by Power(") PrintR(a)
  PrintE(",0.5)")
 
  ValR("2.5",a)
  Ln(a,b)
  Print("Ln(") PrintR(a)
  Print(")=") PrintRE(b)
 
  ValR("14.2",a)
  Log10(a,b)
  Print("Log10(") PrintR(a)
  Print(")=") PrintRE(b)
 
  ValR("-3.7",a)
  Exp(a,b)
  Print("Exp(") PrintR(a)
  Print(")=") PrintRE(b)
 
  ValR("2.6",a)
  Exp10(a,b)
  Print("Exp10(") PrintR(a)
  Print(")=") PrintRE(b)
 
  ValR("25.3",a)
  ValR("1.3",b)
  Power(a,b,c)
  Print("Power(") PrintR(a)
  Print(",") PrintR(b)
  Print(")=") PrintRE(c)
 
  ValR("-32.5",a)
  RealAbs(a,b)
  Print("Abs(") PrintR(a)
  Print(")=") PrintR(b)
  PrintE(" by bit manipulation")
 
  ValR("23.15",a)
  i=Floor(a)
  Print("Floor(") PrintR(a)
  PrintF(")=%I by own function%E",i)
 
  ValR("-23.15",a)
  i=Floor(a)
  Print("Floor(") PrintR(a)
  PrintF(")=%I by own function%E",i)
 
  ValR("23.15",a)
  i=Ceiling(a)
  Print("Ceiling(") PrintR(a)
  PrintF(")=%I by own function%E",i)
 
  ValR("-23.15",a)
  i=Ceiling(a)
  Print("Ceiling(") PrintR(a)
  PrintF(")=%I by own function%E",i)
 
  PutE()
  PrintE("There is no support in Action! for pi.")
RETURN