diff --git a/_03.Standard-library.sz b/_03.Standard-library.sz index d655cdd..1afef2a 100644 --- a/_03.Standard-library.sz +++ b/_03.Standard-library.sz @@ -7,6 +7,11 @@ A short tour of the standard library. Each module's full reference is its own pa The prelude is what every module has without importing anything: the collections and their functions, strings and characters, files and ports, Concurrent ML and scopes, and the macros the language is written with, such as @code{cond}, @code{if-let} and @code{type/derive}. Its reference also covers the builtins, the functions compiled into the runtime rather than written in Bjolang, since every program gets them with the prelude. At the REPL, @code{:show name} prints the same documentation. For more details, see @link["modules/std/prelude.html"]{@code{(std prelude)}}. +@subsection{std/maths} + +Numbers beyond the operators. Integer division has Racket's names: @code{quotient} and @code{remainder} are what @code{/} and @code{%} do, and @code{modulo} takes the sign of the divisor, so @code{(modulo -1 10)} is 9. There are @code{gcd}, @code{lcm}, an integer @code{expt} and an exact @code{integer-sqrt} at every integer type, the @code{exact-} roundings from a double to an int, and the rest of @code{System.Math} over doubles. The prelude has @code{abs}, @code{min}, @code{max} and @code{clamp} from here without an import. +For more details, see @link["modules/std/maths.html"]{@code{(std maths)}}. + @subsection{std/fmt} Formatting in Bjolang is divided into two layers: interpolation and layout. diff --git a/modules/std/maths.sz b/modules/std/maths.sz new file mode 100644 index 0000000..fd1d29f --- /dev/null +++ b/modules/std/maths.sz @@ -0,0 +1,3 @@ +(meta (title "(std maths)")) + +@generate-docs[#:module "std maths"]