Generalised floating point addition: Difference between revisions

m
hint added
m (hint added)
Line 728:
e1 = ba_new(sprintf("1e%d",e)),
res = ba_add(ba_mul(bd,81),e1)
-- res = ba_mul(bd,81)
printf(1,"%2d : %s\n",{n,ba_sprintf("%.eB",res)})
-- printf(1,"%2d : %s\n",{n,ba_sprintf("%B",res)})
s = t & s
e -= 9
end for</lang>
{{out|Output (trimmed)}}
(Use the %B format to better see the difference between adding and not adding e1.)
<pre>
-7 : 1e72
Line 738 ⟶ 741:
21 : 1e72
</pre>
 
===bcd/string arithmetic===
May yet form the basis of something useful in builtins. (same output)
7,804

edits