From 371f1685ca7581dfa38cd250de0ecd9073990a6f41e4ad1f98576e89e1a49232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Bj=C3=B6rnstam?= Date: Tue, 6 Oct 2026 20:09:22 +0200 Subject: [PATCH] (std maths) has a reference page, and Part III a section on it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [ECA](https://eca.dev) Co-Authored-By: eca-agent --- _03.Standard-library.sz | 5 +++++ modules/std/maths.sz | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 modules/std/maths.sz 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"]