[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.2.3 General Integer Operations

101006 ^ZTrim ( Z → Z' )
Strips Z from unnecessary leading nibbles. Counts nibbles required for representation. If that equals used nibbles then quick exit. Else allocates new object, copies significant mantissa nibbles and apends original sign.
102006 ^ZAbs ( Z → |Z| )
Takes the absolute value of Z. If Z is already positive then does nothing. Else duplicate object and change sign.
50B006 ^ZABS ( Z → Z' )
Absolute value.
590006 (^ZSQ) ( Z → Z' )
Computes the square of a zint.
0E0006 ^ZSQRT ( Z → Z' flag )
Calculates integer part of square root. If the number was a square, then flag is TRUE to indicate that the returned result is exact.
3D0006 ^Mod ( Z Zn → Z' )
Make Z modulo N.
0DD006 ^ZMod ( Z1 Z2 → Z' )
105006 ^ZNMax ( Z1 Z2 → NormMax[Z1,Z2] )
Returns the integer with the greatest absolute value. (Returns Z1 if |Z1|≥|Z2|; returns Z2 if |Z1|<|Z2|).
106006 ^ZNMin ( Z1 Z2 → NormMin[Z1,Z2] )
Returns the integer with the smallest absolute value. (Returns Z1 if |Z1|≤|Z2|; returns Z2 if |Z1|>|Z2|).
10D006 ^ZBits ( Z → Z #bits )
Calculates number of bits used in Z.
10E006 ^ZBit? ( Z #bit → Z flag )
Tests if a bit in Z is set. Count starts from zero, as opposed to ZBits.
2B7006 ^ZGCDext ( Z2 Z1 → Z )
Integer GCD.
2B8006 ^ZGcd ( Z2 Z1 → Z )
This is the same entry as ZGCDext.
20A006 ^IEGCD
Internal EGCD for integers.
3D6006 ^IEGCDext ( a b → d u v )
Bezout for integers. d=au+bv=gcd(a,b).
3D9006 ^INEGCD ( a b → d u v )
3DA006 ^EGCDSWAP
3DB006 ^EGCDNEWG
07C007 ^#FACT ( # → Z )
Calculates the factorial of an integer. Works fine for all numbers #0 - #FFFFF, although at some point you will get an out of memory error.
576006 ^factzint ( z → z! )
Factorial for long integers.
215006 ^PA2B2 ( z/% → a+bi )
Internal PA2B2.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated by Carsten Dominik on May, 30 2005 using texi2html