Title says it all
Sync On
Dim MyArray(2) : MyArray(1)=10 : MyArray(2)=10
Do
`Fraction
Text 20,20,str$(Fraction(1,2,10))
`Square Root
Text 20,40,str$(SR(400))
`Mean
for m=1 to array count(MyArray(0)) : inc total#,MyArray(m) : next m : value#=total#/array count(MyArray(0)) : total#=0
Text 20,60,str$(value#)
Sync
Loop
function Fraction(numerator#,denominator#,target#)
value#=(target#/denominator#)*numerator#
endfunction value#
function SR(target#)
value#=SQRT(target#)
endfunction value#
function root(num#,root#)
val#=num#^(1/root#)
endfunction val#
AND NOW SIMPLIFY FUNCTIONS!!!!!
Sync On : Global newnum# : Global newden#
Do
simplify(40,60)
Text 20,20,str$(newnum#)+"/"+str$(newden#)
Sync
Loop
function simplify(numerator#,denominator#)
for n=0 to numerator#/2
for d=0 to denominator#/2
n#=n : d#=d
if n#/d#=numerator#/denominator# then newnum#=n# : newden#=d# : exitfunction
next d
next n
endfunction