Z^3 Deeper Features
Jump to navigation
Jump to search
Function Composition
Functions can be composed using the @ operator. A chain of functions can also be composed using the same technique. Composed function works left to right.
a=(x=>x/3)@(x=>x+2); a(3)
gives 3.
First 3 is divided by 3, and then 2 is added to yield 3 as result.
a=(x=>x+2)@(x=>x/3); a(3)
gives 1.6666666666666667
a=(SIN@COS@TAN); a(45)
gives 0.7749904090605793
Computation with Large Numbers, Decimals of Arbitrary Length, Fractions, Complex Numbers, etc.
Often the accuracy provided by the usual computational language is insufficient to handle more complex computations as well as type specific computations.
The following notations are used to indicate advanced numerical types in Z.
Type | Notation | Example |
---|---|---|
BigInt | n | (60n)! |
Floating Point | fn.n | 23f5.2 |
Complex Number | x+yi | 3+4i |
Fractions | x%%n/d | 23%%5/2 |
(60n)!