Name

about:numbers

Description

Kiezellisp offers integers, rationals, floating point numbers and complex numbers.

Integers

The standard integer types System.Int32 etc and System.Numerics.BigInteger.

user > 1111111111
it: 1111111111
user > :d
#s( :type "System.Int32"
    :value 1111111111 )

user > (* it it)
it: 1234567900987654321
user > :d
#s( :type "System.Int64"
    :value 1234567900987654321 )

user > (* it it)
it: 1524157902149062642981252857789971041
user > :d
#s( :members #s( :is-even false
                 :is-one false
                 :is-power-of-two false
                 :is-zero false
                 :sign 1 )
    :type "System.Numerics.BigInteger"
    :value 1524157902149062642981252857789971041 )

Rationals

The type BigRational.

user > 3/4
it: 3/4
user > :d
#s( :members #s( :denominator 4
                 :numerator 3
                 :sign 1 )
    :type "Numerics.BigRational"
    :value 3/4 )

user > (* 4 it)
it: 3
user > :d
#s( :type "System.Int32"
    :value 3 )

Floating point

The types System.Float, System.Double and System.Decimal. The latter is the preferred type.

user > 2.10
it: 2.10
user > :d
#s( :type "System.Decimal"
    :value 2.10 )

Complex

user > #c(3 4)
it: #c(3 4)
user > :d
#s( :members #s( :imaginary 4
                 :magnitude 5
                 :phase 0.927295218001612
                 :real 3 )
    :type "System.Numerics.Complex"
    :value #c(3 4) )