Mathematical functions

The complete source of builtInTypes_maths.ek9, compiled by the EK9 compiler. Shown on builtInTypes.html.

#!ek9
defines module site.builtInTypes.maths

  defines program

    MathsExample()
      stdout <- Stdout()

      maths <- Maths()

      //sin of pi/2 is 1.0
      halfPi <- maths.pi() / 2.0
      stdout.println("sin(pi/2) = " + $halfPi.sin())

Download builtInTypes_maths.ek9

Output

sin(pi/2) = 1.0