diff options
| author | Taylan Kammer <taylan.kammer@gmail.com> | 2025-12-26 07:09:36 +0100 |
|---|---|---|
| committer | Taylan Kammer <taylan.kammer@gmail.com> | 2025-12-26 07:09:36 +0100 |
| commit | 4210e8538e6e0adf3af7badeab33c619f3db9497 (patch) | |
| tree | c7e5ae8b073eca42a2035772c7edb7a2e897308a /notes/250329-numbers.md | |
| parent | f93437d8d54e26c64a88e4136e38f6a796d7fd8c (diff) | |
Add a note, expand other notes, add dates into notes.
Diffstat (limited to 'notes/250329-numbers.md')
| -rw-r--r-- | notes/250329-numbers.md | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/notes/250329-numbers.md b/notes/250329-numbers.md index 6507a67..5bbfde3 100644 --- a/notes/250329-numbers.md +++ b/notes/250329-numbers.md @@ -1,11 +1,15 @@ +# Number tower +_2025 March_ + +``` exacts: uint : 0...n sint : -n...-1 | uint - ratn : ( p: sint, q: sint ) + ratn : ( p: sint, q: uint ) comp : ( r: ratn, i: ratn ) @@ -43,3 +47,24 @@ inexact operations: double + double = double cmp128 + double = cmp128 [ cmp128 + ( r = double , i = 0 ) ] +``` + +_2025 December_ + +Mixing exact and inexact numbers implicitly should not be allowed. It +should be a type error. Conversion must be explicit. + +Basically there are two numeric towers, not one. The exact numbers +use integers all the way down; for example, an exact complex is a pair +of exact rationals which are each a pair of integers. Inexact numbers +use double, with the only other type being `complex128` which is a +pair of doubles. + +Not sure yet how exactly to deal with unsigned integers. All I know +is that I don't want there to be unsigned rational numbers; that's +just excessive. A rational number always has a signed numerator and +an unsigned denominator. + +See also: + +https://www.deinprogramm.de/sperber/papers/numerical-tower.pdf |
