diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-26 16:38:00 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-26 16:38:00 -0400 |
| commit | 97d5c458cfa039d857301e1ca7d5af3beb37131d (patch) | |
| tree | b460cd850d0537eb71806ba30358840377b27688 /static/inferno/man2/math-0intro.2 | |
| parent | b89dc2331a50c63f8b33272a5c4c61ab98abdaa3 (diff) | |
build: Better Build System
Diffstat (limited to 'static/inferno/man2/math-0intro.2')
| -rw-r--r-- | static/inferno/man2/math-0intro.2 | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/static/inferno/man2/math-0intro.2 b/static/inferno/man2/math-0intro.2 new file mode 100644 index 00000000..573d6076 --- /dev/null +++ b/static/inferno/man2/math-0intro.2 @@ -0,0 +1,79 @@ +.TH MATH-INTRO 2 +.SH NAME +Math: intro \- elementary numerics +.SH SYNOPSIS +.EX +include "math.m"; +math := load Math Math->PATH; +.EE +.SH DESCRIPTION +Inferno's math module and Limbo compiler provide the +fundamental floating point environment and ``elementary functions''. +.PP +Limbo expressions involving only literal and named constants are +evaluated at compile time with all exceptions ignored. +However, +arithmetic on variables is left to run-time, even if data path analysis +shows the value to be a compile time constant. +This implies that tools +generating Limbo source must do their own simplification, and not +expect the compiler to change +.B x/x +into +.BR 1 , +or +.B -(y-x) +into +.BR x-y , +or even +.BR x-0 +into +.BR x . +.PP +Subexpression elimination and other forms of code motion may be done by the +compiler, +but not across calls to the mode and status functions described in +.IR math-fp (2). +Removal of +parentheses or factoring is not performed by the compiler. +The evaluation +order of +.B a+b+c +follows the parse tree and is therefore the same as for +.BR (a+b)+c . +These rules are the same as for Fortran and C. +.PP +Contracted multiply-add instructions (with a single rounding) are not +generated by the compiler, though they may be used in the native BLAS +(linear algebra) +libraries. +All arithmetic follows the IEEE floating point standard, except that +denormalized numbers may be replaced by flush-to-0, depending on what +the hardware makes feasible. +.PP +Binary/decimal conversion is properly rounded. +In particular, printing +a real using +.B %g +and reading it on a different machine is guaranteed to +recover identical bits, including +conversions done by the compiler. +The one exception is that +smaller, faster, but sloppier run-time conversion +routines may be used when mandated by +limited memory embedded systems. +Programmers may assume, however, +that the +features described in these man pages are present in all Inferno +systems intended for general computing. +.SH SOURCE +.B /libinterp/math.c +.SH SEE ALSO +See +.IR math-fp (2) +for floating point control and primitive arithmetic operations, +.IR math-elem (2) +for the classical elementary functions of applied mathematics, +and +.IR math-linalg (2) +for basic linear algebra functions. |
