Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,30 @@
|
|||
Module Exponentiation {
|
||||
\\ a variable can be any type except a string (no $ in name)
|
||||
\\ variable b is long type.
|
||||
\\ by default we pass by value arguments to a function
|
||||
\\ to pass by reference we have to use & before name,
|
||||
\\ in the signature and in the call
|
||||
function pow(a, b as long) {
|
||||
p=a-a ' make p same type as a
|
||||
p++
|
||||
if b>0 then for i=1& to b {p*=a}
|
||||
=p
|
||||
}
|
||||
const fst$="{0::-32} {1}"
|
||||
Document exp$
|
||||
k= pow(11&, 5)
|
||||
exp$=format$(fst$, k, type$(k)="Long")+{
|
||||
}
|
||||
l=pow(11, 5)
|
||||
exp$=format$(fst$, l, type$(l)="Double")+{
|
||||
}
|
||||
m=pow(pi, 3)
|
||||
exp$=format$(fst$, m, type$(m)="Decimal")+{
|
||||
}
|
||||
\\ send to clipboard
|
||||
clipboard exp$
|
||||
\\ send monospaced type text to console using cr char to change lines
|
||||
Print #-2, exp$
|
||||
Rem Report exp$ ' send to console using proportional spacing and justification
|
||||
}
|
||||
Exponentiation
|
||||
Loading…
Add table
Add a link
Reference in a new issue