The module math
A module of commands (property 19). It is not a program: it has no entry. The console loads it and calls its exports with the call form (docs/MODULE_CONTRACT.md, section 4). The tool makes the description of each export from this source: the name, the parameters, the result, and the first sentence of the comment (tools/kerneltool/describe.odin).
| Fact | Value |
|---|---|
| Source | modules/math |
| Boot image | in the boot image; the image is not built, so its size is not known |
| Imports | none |
| Imported by | none |
Exports
| Export | What it does |
|---|---|
| gcd(first: Integer, second: Integer) -> Integer | gives the greatest common divisor |
| power(base: Integer, exponent: Integer) -> Integer | gives an integer to a power |
| fibonacci(index: Integer) -> Integer | gives the Fibonacci number of an index |
| next_prime(from: Integer) -> Integer | gives the first prime from an integer |
| number(text: Text) -> Integer | gives the integer that a text holds |
| square_root(value: Integer) -> Integer | gives the largest integer whose square is not above a value, or -1 with an error record: the error kind Too_Small, when the value is negative |
| roman(number: Integer) -> Text | gives an integer in Roman numerals |
| reverse(text: Text) -> Text | gives the bytes of a text, last first |
Read from the source of the module, as the build reads it to describe the exports (tools/kerneltool/describe.odin).
