E
Elias Athanasopoulos
Hello!
I don't know if this is intentional, but is there a reason
that 0.0 holds the sign?
tiny = 0.0000000000000000001
inf = 1/tiny
a = 1/inf
b = -1/inf
p a, b, (a-b), (a+b)
a = -1/inf
b = 1/inf
p a, b, (a-b), (a+b)
I can hardly imagine you can use it somehow; OTOH it can
make the output a little uglier.
I checked Python and altough 0.0 carries the sign it is not
used in the results of subtraction/addition, as it is in Ruby.
Regards,
--
University of Athens I bet the human brain
Physics Department is a kludge --Marvin Minsky
--- /home/elathan/hacking/ruby/numeric.c.orig 2004-05-05 00:18:12.000000000 +0300
+++ /home/elathan/hacking/ruby/numeric.c 2004-05-05 00:18:41.000000000 +0300
@@ -502,6 +502,7 @@
avalue = fabs(value);
if (avalue == 0.0) {
fmt = "%.1f";
+ value = avalue;
}
else if (avalue < 1.0e-3) {
d1 = avalue;
I don't know if this is intentional, but is there a reason
that 0.0 holds the sign?
tiny = 0.0000000000000000001
inf = 1/tiny
a = 1/inf
b = -1/inf
p a, b, (a-b), (a+b)
a = -1/inf
b = 1/inf
p a, b, (a-b), (a+b)
I can hardly imagine you can use it somehow; OTOH it can
make the output a little uglier.
I checked Python and altough 0.0 carries the sign it is not
used in the results of subtraction/addition, as it is in Ruby.
Regards,
--
University of Athens I bet the human brain
Physics Department is a kludge --Marvin Minsky
--- /home/elathan/hacking/ruby/numeric.c.orig 2004-05-05 00:18:12.000000000 +0300
+++ /home/elathan/hacking/ruby/numeric.c 2004-05-05 00:18:41.000000000 +0300
@@ -502,6 +502,7 @@
avalue = fabs(value);
if (avalue == 0.0) {
fmt = "%.1f";
+ value = avalue;
}
else if (avalue < 1.0e-3) {
d1 = avalue;