summaryrefslogtreecommitdiff
path: root/notes/numbers.md
blob: 6507a670171c1ef5df192409498b157e8e69eb49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

exacts:

  uint : 0...n

  sint : -n...-1 | uint

  ratn : ( p: sint, q: sint )

  comp : ( r: ratn, i: ratn )


inexacts:

  double : ieee754 double with +inf, -inf, +nan, -nan

  cmp128 : ( r: double , i: double )


exact operations:

  uint + uint = uint

  sint + uint = sint

  ratn + uint = ratn  [ ratn + ( p = uint , q = 0 ) ]

  ratn + sint = ratn  [ ratn + ( p = sint , q = 0 ) ]

  ratn + ratn = ratn

  comp + uint = comp  [ comp + ( r = ( p = uint , q = 0 ) , i = 0 ) ]

  comp + sint = comp  [ comp + ( r = ( p = sint , q = 0 ) , i = 0 ) ]

  comp + ratn = comp  [ comp + ( r = ratn , i = 0 ) ]

  comp + comp = comp


inexact operations:

  double + double = double

  cmp128 + double = cmp128  [ cmp128 + ( r = double , i = 0 ) ]