Skip to content

Latest commit

 

History

History
83 lines (46 loc) · 2.04 KB

onion_math.md

File metadata and controls

83 lines (46 loc) · 2.04 KB

Module onion_math

Math API.

Authors: Alexander Færøy (ahf@0x90.dk).

Function Index

ceil/1Round a given number upwards towards to the nearest integer.
floor/1Round a given number downwards towards the nearest integer.
mod/2Return X mod Y.
mod_pow/3Return B^E mod M.
pow/2Return X^N.

Function Details

ceil/1


ceil(Value) -> integer()
  • Value = number()

Round a given number upwards towards to the nearest integer.

floor/1


floor(Value) -> integer()
  • Value = number()

Round a given number downwards towards the nearest integer.

mod/2


mod(X, Y) -> integer()
  • X = integer()
  • Y = integer()

Return X mod Y.

mod_pow/3


mod_pow(Base, Exponent, Modulus) -> Result
  • Base = number()
  • Exponent = number()
  • Modulus = number()
  • Result = number()

Return B^E mod M.

pow/2


pow(X, N) -> integer()
  • X = integer()
  • N = integer()

Return X^N.