aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/math/number/frac.lux
blob: d543143f68559c6b7dfc916cd403572eb15642a5 (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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
(.require
 [library
  [lux (.except)
   ["$" documentation]
   [data
    [collection
     ["[0]" list]]]]]
 [\\library
  ["[0]" /]])

(def math
  (.List $.Documentation)
  (list ($.definition /.cos)
        ($.definition /.sin)
        ($.definition /.tan)
        ($.definition /.acos)
        ($.definition /.asin)
        ($.definition /.atan)
        ($.definition /.exp)
        ($.definition /.log)
        ($.definition /.ceil)
        ($.definition /.floor)
        ($.definition /.root_2)
        ($.definition /.root_3)
        ($.definition /.round)
        ($.definition /.factorial)
        ($.definition /.hypotenuse)
        ($.definition /.sinh)
        ($.definition /.csch)
        ($.definition /.cosh)
        ($.definition /.sech)
        ($.definition /.tanh)
        ($.definition /.coth)
        ($.definition /.asinh)
        ($.definition /.acosh)
        ($.definition /.atanh)
        ($.definition /.acoth)
        ($.definition /.asech)
        ($.definition /.acsch)

        ($.definition /.e
          "The base of the natural logarithm.")

        ($.definition /.pi
          "The ratio of a circle's circumference to its diameter.")

        ($.definition /.tau
          "The ratio of a circle's circumference to its radius.")

        ($.definition /.pow
          ""
          [(pow param subject)])

        ($.definition /.atan_2
          ""
          [(atan_2 x y)])

        ($.definition /.log_by
          ""
          [(log_by base it)])
        ))

(`` (def .public documentation
      (.List $.Documentation)
      (list.partial ($.module /._
                              "")

                    ($.definition /.positive?)
                    ($.definition /.negative?)
                    ($.definition /.zero?)
                    ($.definition /.opposite)
                    ($.definition /.abs)
                    ($.definition /.signum)
                    ($.definition /.nat)
                    ($.definition /.int)
                    ($.definition /.rev)
                    ($.definition /.equivalence)
                    ($.definition /.order)
                    ($.definition /.smallest)
                    ($.definition /.biggest)
                    ($.definition /.addition)
                    ($.definition /.multiplication)
                    ($.definition /.minimum)
                    ($.definition /.maximum)
                    ($.definition /.number?)
                    ($.definition /.decimal)
                    ($.definition /.bits)
                    ($.definition /.of_bits)
                    ($.definition /.binary)
                    ($.definition /.octal)
                    ($.definition /.hex)
                    ($.definition /.hash)

                    ($.definition /.=
                      "Frac(tion) equivalence."
                      [(= reference sample)])

                    ($.definition /.<
                      "Frac(tion) less-than."
                      [(< reference sample)])

                    ($.definition /.<=
                      "Frac(tion) less-than or equal."
                      [(<= reference sample)])

                    ($.definition /.>
                      "Frac(tion) greater-than."
                      [(> reference sample)])

                    ($.definition /.>=
                      "Frac(tion) greater-than or equal."
                      [(>= reference sample)])

                    (,, (with_template [<name> <doc>]
                          [($.definition <name>
                             <doc>)]

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

                    ($.definition /./%
                      ""
                      [(/% param subject)])

                    (,, (with_template [<name> <doc>]
                          [($.definition <name>
                             <doc>)]

                          [/.min "Frac(tion) minimum."]
                          [/.max "Frac(tion) minimum."]
                          ))

                    (,, (with_template [<name> <doc>]
                          [($.definition <name>
                             <doc>)]

                          [/.not_a_number "Not a number."]
                          [/.positive_infinity "Positive infinity."]
                          [/.negative_infinity "Negative infinity."]
                          ))

                    ($.definition /.not_a_number?
                      "Tests whether a frac is actually not-a-number."
                      [(not_a_number? it)])

                    ($.definition /.approximately?
                      ""
                      [(approximately? margin_of_error standard value)])

                    ($.definition /.mod
                      ""
                      [(mod divisor dividend)])

                    ..math
                    )))