This is the mail archive of the
mauve-patches@sources.redhat.com
mailing list for the Mauve project.
Math.min and Math.max / small error
- From: David Gilbert <david dot gilbert at object-refinery dot com>
- To: mauve-patches at sources dot redhat dot com
- Date: Mon, 06 Sep 2004 13:46:15 +0100
- Subject: Math.min and Math.max / small error
I noticed that the first and third checks in the "+/- zero" group are
duplicates. I think the signs should be reversed for one of the checks
in each:
Index: max.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/Math/max.java,v
retrieving revision 1.2
diff -u -r1.2 max.java
--- max.java 16 Feb 1999 05:37:14 -0000 1.2
+++ max.java 6 Sep 2004 12:37:46 -0000
@@ -29,7 +29,7 @@
{
harness.check (Double.toString (Math.max (0.0, -0.0)), "0.0");
harness.check (Double.toString (Math.max (-0.0, -0.0)), "-0.0");
- harness.check (Double.toString (Math.max (0.0, -0.0)), "0.0");
+ harness.check (Double.toString (Math.max (-0.0, 0.0)), "0.0");
harness.check (Double.toString (Math.max (0.0, 0.0)), "0.0");
harness.check (Double.toString (Math.max (1.0, 2.0)), "2.0");
harness.check (Double.toString (Math.max (2.0, 1.0)), "2.0");
@@ -53,7 +53,7 @@
harness.check (Float.toString (Math.max (0.0f, -0.0f)), "0.0");
harness.check (Float.toString (Math.max (-0.0f, -0.0f)), "-0.0");
- harness.check (Float.toString (Math.max (0.0f, -0.0f)), "0.0");
+ harness.check (Float.toString (Math.max (-0.0f, 0.0f)), "0.0");
harness.check (Float.toString (Math.max (0.0f, 0.0f)), "0.0");
harness.check (Float.toString (Math.max (1.0f, 2.0f)), "2.0");
harness.check (Float.toString (Math.max (2.0f, 1.0f)), "2.0");
Index: min.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/Math/min.java,v
retrieving revision 1.4
diff -u -r1.4 min.java
--- min.java 19 Aug 2001 06:32:20 -0000 1.4
+++ min.java 6 Sep 2004 12:41:42 -0000
@@ -30,7 +30,7 @@
harness.checkPoint("Small doubles");
harness.check (Double.toString (Math.min (0.0, -0.0)), "-0.0");
harness.check (Double.toString (Math.min (-0.0, -0.0)), "-0.0");
- harness.check (Double.toString (Math.min (0.0, -0.0)), "-0.0");
+ harness.check (Double.toString (Math.min (-0.0, 0.0)), "-0.0");
harness.check (Double.toString (Math.min (0.0, 0.0)), "0.0");
harness.check (Double.toString (Math.min (1.0, 2.0)), "1.0");
harness.check (Double.toString (Math.min (2.0, 1.0)), "1.0");
@@ -73,7 +73,7 @@
harness.check (Float.toString (Math.min (0.0f, -0.0f)), "-0.0");
harness.check (Float.toString (Math.min (-0.0f, -0.0f)), "-0.0");
- harness.check (Float.toString (Math.min (0.0f, -0.0f)), "-0.0");
+ harness.check (Float.toString (Math.min (-0.0f, 0.0f)), "-0.0");
harness.check (Float.toString (Math.min (0.0f, 0.0f)), "0.0");
harness.check (Float.toString (Math.min (1.0f, 2.0f)), "1.0");
harness.check (Float.toString (Math.min (2.0f, 1.0f)), "1.0");
Regards,
Dave Gilbert