Math Functions

Math Functions

 

Math library of SIL.

Functions Summary

  • abs — Returns the absolute value of a number. The absolute value of a number is the number without its sign.
  • bitwise_and — Takes two numbers as operands and does AND on every bit of two numbers.
  • bitwise_lshift — Takes two numbers, left shifts the bits of the first operand, the second operand decides the number of places to shift.
  • bitwise_not — Takes one number and inverts all bits of it.
  • bitwise_or — Takes two numbers as operands and does OR on every bit of two numbers.
  • bitwise_rshift — Takes two numbers, right shifts the bits of the first operand, the second operand decides the number of places to shift.
  • bitwise_rushift — Takes two numbers, right shifts the bits of the first operand.The vacant leftmost position is filled with 0 instead of the sign bit.
  • bitwise_xor — Takes two numbers as operands and does XOR on every bit of two numbers.
  • ceiling — Returns number rounded up, away from zero, to the nearest multiple of significance.
  • cos — Returns the cosine of the given angle.
  • degrees — Converts radians to degrees.
  • e number — Constant function. Returns the value of e.
  • exp — Returns e raised to the power of number.
  • fact — Returns the factorial of a number.
  • floor — Rounds number down, toward zero, to the nearest multiple of significance.
  • formatNumber — Formats a number according to a format string.
  • ln — Returns the natural logarithm of a number. Natural logarithms are based on the constant e (2.71828182845904).
  • log — Returns the logarithm of a number to the base you specify.
  • pi — Constant function. Returns the value of Pi.
  • power — Returns the number raised to the desired power.
  • radians — Converts degrees into radians.
  • rand — Returns a random number between 0.00 and 1.00.
  • random — Returns a random int value between 0 (inclusive) and the specified value (exclusive). This works for integers only.
  • roman — Converts an Arabic numeral to Roman numeral, as text, of course.
  • round — Rounds a number to a specified number of digits.
  • sign — Determines the sign of a number (signum).
  • sin — Returns the sine of the given angle.
  • sqrt — Returns a positive square root.
  • tan — Returns the tangent of an angle, provided in radians.
  • trunc — Truncates a number to a specified precision.