Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/Currying/ALGOL-68/currying.alg
Normal file
10
Task/Currying/ALGOL-68/currying.alg
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# Raising a function to a power #
|
||||
|
||||
MODE FUN = PROC (REAL) REAL;
|
||||
PROC pow = (FUN f, INT n, REAL x) REAL: f(x) ** n;
|
||||
OP ** = (FUN f, INT n) FUN: pow (f, n, );
|
||||
|
||||
# Example: sin (3 x) = 3 sin (x) - 4 sin^3 (x) (follows from DeMoivre's theorem) #
|
||||
|
||||
REAL x = read real;
|
||||
print ((new line, sin (3 * x), 3 * sin (x) - 4 * (sin ** 3) (x)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue