Arithmetic evaluation: Difference between revisions

m
fraction accuracy
m (→‎{{header|Sidef}}: minor code simplifications)
m (fraction accuracy)
Line 3,644:
 
procedure get_token()
atom n, fraction
integer dec
skipspaces()
Line 3,656:
end while
if ch='.' then
dec = 101
fraction = 0
while 1 do
nxtch(0)
if ch<'0' or ch>'9' then exit end if
nfraction += (fraction*10 + ch-'0')/dec
dec *= 10
end while
n += fraction/dec
end if
-- if find(ch,"eE") then -- you get the idea
7,805

edits