+2003-10-08 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/StrictMath.java (toDegrees): Multiply before
+ dividing.
+ (toRadians): Likewise.
+
+2003-10-08 C. Brian Jones <cbj@gnu.org>
+
+ * java/lang/Math.java
+ (toRadians): multiply before dividing to reduce decimal error
+ (toDegrees): ditto
+
2003-10-08 Michael Koch <konqueror@gmx.de>
* gnu/gcj/protocol/core/Connection.java,
*/
public static int round(float a)
{
+ // this check for NaN, from JLS 15.21.1, saves a method call
+ if (a != a)
+ return 0;
return (int) floor(a + 0.5f);
}
*/
public static long round(double a)
{
+ // this check for NaN, from JLS 15.21.1, saves a method call
+ if (a != a)
+ return 0;
return (long) floor(a + 0.5d);
}
*/
public static double toRadians(double degrees)
{
- return degrees * (PI / 180);
+ return (degrees * PI) / 180;
}
/**
*/
public static double toDegrees(double rads)
{
- return rads * (180 / PI);
+ return (rads * 180) / PI;
}
}
*/
public static double toRadians(double degrees)
{
- return degrees * (PI / 180);
+ return (degrees * PI) / 180;
}
/**
*/
public static double toDegrees(double rads)
{
- return rads * (180 / PI);
+ return (rads * 180) / PI;
}
/**