aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/math/number/int.lux
blob: 8e3e737f98543b4c98a480331f11fbce9f628e97 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
(.using
 [library
  [lux (.except private)
   ["$" documentation (.only documentation:)]
   [data
    ["[0]" text (.only \n)
     ["%" \\format (.only format)]]]
   [macro
    ["[0]" template]]]]
 [\\library
  ["[0]" /]])

(documentation: /.=
  "Int(eger) equivalence."
  [(= reference sample)])

(documentation: /.<
  "Int(eger) less-than."
  [(< reference sample)])

(documentation: /.<=
  "Int(eger) less-than or equal."
  [(<= reference sample)])

(documentation: /.>
  "Int(eger) greater-than."
  [(> reference sample)])

(documentation: /.>=
  "Int(eger) greater-than or equal."
  [(>= reference sample)])

(with_template [<name> <doc>]
  [(documentation: <name>
     <doc>)]

  [/.min "Int(eger) minimum."]
  [/.max "Int(eger) maximum."]
  )

(with_template [<name> <doc>]
  [(documentation: <name>
     <doc>)]

  [/.+ "Int(eger) addition."]
  [/.- "Int(eger) substraction."]
  [/.* "Int(eger) multiplication."]
  [/./ "Int(eger) division."]
  [/.% "Int(eger) remainder."]
  [/./% "Int(eger) [division remainder]."]
  )

(documentation: /.opposite
  "A value of equal magnitude and opposite sign.")

(documentation: /.abs
  "A value of equal magnitude and positive sign.")

(documentation: /.signum
  "A value (either -1, 0 or +0) which represents the sign.")

(documentation: /.mod
  (format "Integer modulo."
          \n "Note: The modulo and the remainder are not the same.")
  [(mod divisor dividend)])

(documentation: /.gcd
  "Greatest Common Divisor.")

(documentation: /.extended_gcd
  "Extended euclidean algorithm.")

(documentation: /.lcm
  "Least Common Multiple.")

(documentation: /.right_shifted
  "Signed/arithmetic bitwise right-shift."
  [(right_shifted parameter subject)])

(.def: .public documentation
  (.List $.Module)
  ($.module /._
            ""
            [..=
             ..<
             ..<=
             ..>
             ..>=
             ..min
             ..max
             ..+
             ..-
             ..*
             ../
             ..%
             ../%
             ..opposite
             ..abs
             ..signum
             ..mod
             ..gcd
             ..extended_gcd
             ..lcm
             ..right_shifted
             ($.default /.positive?)
             ($.default /.negative?)
             ($.default /.zero?)
             ($.default /.even?)
             ($.default /.odd?)
             ($.default /.co_prime?)
             ($.default /.frac)
             ($.default /.equivalence)
             ($.default /.order)
             ($.default /.enum)
             ($.default /.interval)
             ($.default /.addition)
             ($.default /.multiplication)
             ($.default /.maximum)
             ($.default /.minimum)
             ($.default /.binary)
             ($.default /.octal)
             ($.default /.decimal)
             ($.default /.hex)
             ($.default /.hash)]
            []))