Arbitrary-size, safe natural number ≥ 0. See also Natural.Morph
Whole number (integer) ≥ 0 of arbitrary precision.
Either 0 directly or a positive number represented by the bit I
followed by some
Bit
s
Why does the type look like this?
If you need a natural number representation with a specific number of bits, you can try
ArraySized Bit (Exactly (On bitLength))
For larger numbers, where you want to allow numbers of arbitrary precision,
only our version can enforce that ==
always gives the correct answer,
since the ArraySized
could be constructed with leading O
s!
RecordWithoutConstructorFunction { bitsAfterI : List Bit }
Positive natural number, can be arbitrarily large
fromN : N range_ -> Natural
Convert from a natural number of type N
toN : Natural -> N (N.Min (N.Up0 minX_))
Convert to a natural number of type N
Keep in mind that this can overflow
since N
is fixed in bit size just like Int
while Natural
is not.