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 1 > 1111111111
it: 1111111111
user 2 > :d
#s( :type "System.Int32"
    :value 1111111111 )

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

user 3 > (* it it)
it: 1524157902149062642981252857789971041
user 4 > :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 1 > 3/4
it: 3/4
user 2 > :d
#s( :members #s( :denominator 4
                 :numerator 3
                 :sign 1 )
    :type "Numerics.BigRational"
    :value 3/4 )

user 2 > (* 4 it)
it: 3
user 3 > :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 1 > 2.10
it: 2.10
user 2 > :d
#s( :type "System.Decimal"
    :value 2.10 )

Complex

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