From a930e5f4dc35f6b215bb7dd1335d3636e8e69dca Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Sun, 11 May 2014 15:45:35 +0400 Subject: [PATCH] Fixes the Math.ulp method --- .../src/main/java/org/teavm/classlib/java/lang/TMath.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TMath.java b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TMath.java index 12abdb30c..a908c1bd9 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TMath.java +++ b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TMath.java @@ -152,11 +152,11 @@ public final class TMath extends TObject { } public static double ulp(double d) { - return pow(1, -getExponent(d) - 52); + return pow(2, getExponent(d) - 52); } public static float ulp(float d) { - return (float)pow(1, -getExponent(d) - 23); + return (float)pow(2, getExponent(d) - 23); } public static double signum(double d) {