aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/math/number.lux
blob: 7fd74e5a0915c94c4b68a338ce0dcc14617a049a (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
(.require
 [library
  [lux (.except private)
   ["$" documentation]
   [data
    ["[0]" text (.only \n)
     ["%" \\format (.only format)]]]]]
 [\\library
  ["[0]" /]]
 ["[0]" /
  ["[1][0]" i8]
  ["[1][0]" i16]
  ["[1][0]" i32]
  ["[1][0]" i64]
  ["[1][0]" nat]
  ["[1][0]" int]
  ["[1][0]" rev]
  ["[1][0]" frac]
  ["[1][0]" ratio]
  ["[1][0]" complex]])

(`` (.def .public documentation
      (.List $.Module)
      ($.module /._
                ""
                [(,, (with_template [<name> <encoding> <no_commas> <with_commas>]
                       [($.documentation <name>
                          (format "Given syntax for a " <encoding> " number, generates a Nat, an Int, a Rev or a Frac.")
                          [<no_commas>]
                          ["Allows for the presence of commas (,) among the digits."
                           <with_commas>])]

                       [/.bin "binary" (bin "11001001") (bin "11,00,10,01")]
                       [/.oct "octal" (oct "615243") (oct "615,243")]
                       [/.hex "hexadecimal" (hex "deadBEEF") (hex "dead,BEEF")]
                       ))]
                [/i8.documentation
                 /i16.documentation
                 /i32.documentation
                 /i64.documentation
                 /nat.documentation
                 /int.documentation
                 /rev.documentation
                 /frac.documentation
                 /ratio.documentation
                 /complex.documentation])))