Anonymous user
Generalised floating point addition: Difference between revisions
Generalised floating point addition (view source)
Revision as of 19:30, 23 December 2013
, 10 years agoRewrote the task to be less prescriptive
m (→{{header|Ruby}}: copy/paste error) |
(Rewrote the task to be less prescriptive) |
||
Line 1:
{{Template:Draft task}}
Define addition for floating point numbers where the digits are stored in an arbitrary base; e.g. the digits can be stored as binary, decimal, [[wp:Binary-coded decimal|binary-coded decimal]], or even [[balanced ternary]].
If it is not possible to implement code
*
*
'''Test case:'''
{|class="wikitable" style="text-align: center; margin: 1em auto 1em auto;"
|+ Calculate the terms for -7 to 21 in this sequence of calculations
Line 26 ⟶ 27:
|etc.|| The final calculation will be over 256 digits wide || 1e72
|}
;Bonus
Make the template (module, class, mixing, etc.) able to successfully handle using other bases to perform the above test case. Demonstrate using [[balanced ternary]].
=={{header|ALGOL 68}}==
{{works with|ALGOL 68|Revision 1 - one minor extension to language used - PRAGMA READ, similar to C's #include directive.}}
|