Anonymous user
Generalised floating point addition: Difference between revisions
m
→base 10 only: change the E in the exponent to be lowercase to match the task narrative. -- ~~~~
m (→base 10 only: added comment about LINESIZE bif. -- ~~~~) |
m (→base 10 only: change the E in the exponent to be lowercase to match the task narrative. -- ~~~~) |
||
Line 637:
sum=(sum+addend.k)/1 /*a way to elide trailing zeroes.*/
say right(k,3) 'sum='translate(_,"e",'E') /*lets lowercase the E. */
end /*k*/
exit /*stick a fork in it, we're done.*/</lang>
'''output'''
<pre style="overflow:scroll">
Line 673 ⟶ 676:
21 1e-189 [266 digits]
═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
-7 sum=
-6 sum=
-5 sum=
-4 sum=
-3 sum=
-2 sum=
-1 sum=
0 sum=
1 sum=
2 sum=
3 sum=
4 sum=
5 sum=
6 sum=
7 sum=
8 sum=
9 sum=
10 sum=
11 sum=
12 sum=
13 sum=
14 sum=
15 sum=
16 sum=
17 sum=
18 sum=
19 sum=
20 sum=
21 sum=
</pre>
|