title "Integers"
header "The integer data types"
[These are the various integer types available in Pliant:]
table columns 2
cell [Int] ; cell [processor sized integer]
cell [Int8] ; cell [8 bits encoded integer]
cell [Int16] ; cell [16 bits encoded integer]
cell [Int32] ; cell [32 bits encoded integer]
cell [Int64] ; cell [64 bits encoded integer]
cell [Intn] ; cell [variable size integer]
cell [uInt] ; cell [processor sized positive integer]
cell [uInt8] ; cell [8 bits encoded positive integer]
cell [uInt16] ; cell [16 bits encoded positive integer]
cell [uInt32] ; cell [32 bits encoded positive integer]
cell [uInt64] ; cell [64 bits encoded positive integer]
para
[The only assertion you are allowed to do about] ; fixed [ Int ] ; [and] ; fixed [ uInt ] ; [ encoding is that it is at least 32 bits.]
header "The integer operations"
table columns 2
cell
listing
`a ¤+ `b
cell
[sums the two numbers[lf]]
[If the debugging level is equal or greater than 2 and the operation leads to an overflow, a run time error will be reported]
cell
listing
`a ¤- `b
cell
[substract]
cell
listing
`a ¤* `b
cell
[multiply]
cell
listing
`a ¤\ `b
cell
[integer division (the result is an integer)]
cell
listing
`a ¤% `b
cell
[integer modulus (the result is the rest of the integer division)]
cell
listing
`a ¤^ `b
cell
[exponent]
cell
listing
`a ¤.+. `b
`a ¤.-. `b
`a ¤.*. `b
`a ¤.^. `b
cell
[same as the previous ones, but overflows are ignored.]
cell
listing
¤.not. `a
`a ¤.and. `b
`a ¤.or. `b
`a ¤.xor. `b
cell
[bit operations.]