You can take huge numbers, and multiply them! it's not incredibly accurate, but it does use double floats. Multiplying, Dividing, Subtracting, and Adding are all supported.
This demo, which includes the functions, first demonstrates multiplication by...
Finding the force that two protons at piE-10 meters apart would exert on eachother. (~9E9 * 1.6E-19 * 1.6E-19 / 3.14E-10^2)
The next demo is addition. That demo adds up the mass of all 8 planets in our solar system and the sun (stupid pluto), and then subtracts the mass that the sun loses in a billion years, which can be calculated with this:
1.534 x 10^13=mass the sun loses every hour
24*365*1000000000=hours in a billion years
type sci
num1 as double float
num2 as integer
endtype
sync rate 10000
dim array(20) as sci
scinum(8.987551787368176,9,0) `the electrostatic constant is array(0)
scinum(1.602,-19,1)
scinum(1.602,-19,2)
scinum(3.14159265358979,-10,3)
`k=array(0),q1=array(1),q2=array(2),d=array(3), F=k*q1*q2/d^2
display(0,"k: ")
display(1,"q1: ")
display(2,"q2: ")
display(3,"d: ")
multiply(0,1,4)
display(4,"K*q1: ")
multiply(4,2,4)
display(4,"K*q1*q2: ")
multiply(3,3,5)
display(5,"d^2: ")
divide(4,5,6)
display(6,"K*q1*q2/d^2: ")
print "Press a button to test out adding"
while scancode()=0
endwhile
`So, testing out adding and subtracting, how about the
`mass of every planet in the solar system, minus the
`mass the sun expells in a billion years?
`1.534 x 10^13=mass the sun loses every hour
`24*365*1000000000=hours in a billion years
`mass of the planets according to http://www.smartconversion.com/otherInfo/Mass_of_planets_and_the_Sun.aspx
`The Sun 1.9891*10^30
`Jupiter 1.8986*10^27
`Saturn 5.6846*10^26
`Uranus 8.6810*10^25
`Neptune 1.0243*10^26
`Earth 5.9736*10^24
`Venus 4.8685*10^24
`Mars 6.4185*10^23
`Mercury 3.3022*10^23
`so planets-1.534*10^13*24*365*1000000000 (also, sorry pluto!)
scinum(1.534,13,0) `-mass/hour
scinum(2.4,1,1)
scinum(3.65,2,2)
scinum(1,9,3)
display(3," ")
multiply(0,1,0)
multiply(0,2,0)
multiply(0,3,0)
display(0,"Mass lost by the sun in a billion years: ")
scinum(1.9891,30,1)`sun
scinum(1.8986,27,2)
scinum(5.6846,26,3)
scinum(8.6810,25,4)
scinum(1.0243,26,5)
scinum(5.9736,24,6)
scinum(4.8685,24,7)
scinum(6.4185,23,8)
scinum(3.3022,23,9)
add(1,2,1)
display(1,"Weight of the sun and jupiter: ")
add(1,3,1)
add(1,4,1)
add(1,5,1)
add(1,6,1)
add(1,7,1)
add(1,8,1)
add(1,9,1)
display(1,"Weight of all the planets (Sept pluto): ")
subtract(1,0,10)
display(10,"minus 1,000,000,000 years of lost mass: ")
print "Press a button to exit"
while scancode()=0
endwhile
end
while scancode()=0
endwhile
end
function display(a as integer,beforetext as string)
print beforetext+str$(array(a).num1)+"*10^"+str$(array(a).num2)
endfunction
function scinum(a as double float, b as integer, result as integer)
array(result).num1=a
array(result).num2=b
reduce(result)
endfunction
function multiply(a as integer, b as integer,result as integer)
array(result).num1=array(a).num1*array(b).num1
array(result).num2=array(a).num2+array(b).num2
reduce(result)
endfunction
function divide(a as integer, b as integer,result as integer)
array(result).num1=array(a).num1/array(b).num1
array(result).num2=array(a).num2-array(b).num2
reduce(result)
endfunction
function add(a as integer, b as integer,result as integer)
convert(a,b,result)
array(result).num1=array(b).num1+array(result).num1
reduce(result)
endfunction
function subtract(a as integer, b as integer,result as integer)
convert(a,b,result)
array(result).num1=array(result).num1-array(b).num1
reduce(result)
endfunction
`B and A must be less than 15 digits apart.
function convert(a as integer, b as integer, result as integer)
difference=(array(a).num2-array(b).num2)
if difference<0
difference=0-difference
array(result).num1=array(a).num1*1.0/(10.0^difference*1.0)
array(result).num2=array(a).num2+difference
else
if difference>0
array(result).num1=array(a).num1*10^difference
array(result).num2=array(a).num2-difference
else
if difference=0
array(result).num1=array(a).num1
array(result).num2=array(a).num2
endif
endif
endif
endfunction
function reduce(result as integer)
temp=0
if array(result).num1=0 then exitfunction
if array(result).num1<0
temp=1
array(result).num1=-array(result).num1
endif
if array(result).num1>0
while array(result).num1=>10.0 or array(result).num1<1.0
if array(result).num1=>10.0
array(result).num1=array(result).num1/10
array(result).num2=array(result).num2+1
endif
if array(result).num1<1.0
array(result).num1=array(result).num1*10
array(result).num2=array(result).num2+1
endif
endwhile
endif
if temp=1 then array(result).num1=-array(result).num1
endfunction
Enjoy