1 Jul 2004 01:08
c = b / a
Ruud H.G. van Tol <rvtol <at> isolution.nl>
2004-06-30 23:08:56 GMT
2004-06-30 23:08:56 GMT
I need a general division recipe.
I now have this:
# Calculate c = a / b.
# Both a and b are positive numbers.
# The result c is an integer value, rounded down towards 0.
--- div.rc ---
VERBOSE = yes
DEFAULT = /dev/null
dot = "."
a = 20
b = 9
c = 0
:0
* 1^0
*$ $a^0
*$ -$b^0
{
:0
*$ dot ?? $a^1 > $b
{ } c = $=
}
--- div.rc ---
Does anyone have a better approach? Preferably one that
can cope with negative numbers too.
--
--
Grtz, Ruud
RSS Feed