Post by bluatigro on Jul 31, 2018 8:34:25 GMT
i know that JB can haldle big int's
but i want big real's to
this is a try to make them
first step : + and * for positive big int's
i need help whit - and / for al big int's
and if have them i wil try big real
but i want big real's to
this is a try to make them
first step : + and * for positive big int's
i need help whit - and / for al big int's
and if have them i wil try big real
'' bluatigro 31 jul 2018
'' bigint + bigreal
q$ = "2"
f$ = "2"
for i = 1 to 20
print i , q$
q$ = multiply$( q$ , f$ )
next i
end
function zero$( i )
zero$ = left$( "00000000000000000000000000000000000000000" _
+ "0000000000000000000000000000000000000000000000000000" _
+ "0000000000000000000000000000000000000000000000000000" _
+ "0000000000000000000000000000000000000000000000000000" _
+ "0000000000000000000000000000000000000000000000000000" _
+ "0000000000000000000000000000000000000000000000000000" _
+ "0000000000000000000000000000000000000000000000000000" _
, i )
end function
function add$( a$ , b$ )
if len( a$ ) < len( b$ ) then
a$ = zero$( len( b$ ) - len( a$ ) ) + a$
end if
if len( b$ ) < len( a$ ) then
b$ = zero$( len( a$ ) - len( b$ ) ) + b$
end if
a$ = "0" + a$
b$ = "0" + b$
for t = len( a$ ) to 1 step -1
i = val( mid$( a$ , t , 1 ) )
j = val( mid$( b$ , t , 1 ) )
k = i + j + m
uit$ = str$( k mod 10 ) + uit$
m = int( k / 10 )
next t
if left$( uit$ , 1 ) = "0" then
uit$ = right$( uit$ , len( uit$ ) - 1 )
end if
add$ = uit$
end function
function x$( a$ , i )
a$ = "0" + a$
for t = len( a$ ) to 1
j = val( mid$( a$ , t , 1 ) )
k = j * i + m
uit$ = str$( k mod 10 ) + uit$
m = int( k / 10 )
next t
if left$( uit$ , 1 ) = "0" then
uit$ = right$( uit$ , len( uit$ ) - 1 )
end if
x$ = uit$
end function
function multiply$( a$ , b$ )
for t = len( b$ ) to 1
i = val( mid$( b$ , t , 1 ) )
uit$ = add$( uit$ , x$( a$ , i ) )
a$ = a$ + "0"
next t
multiply$ = uit$
end function