From e1718f60cc6b97b75856adf59d01595fedde9171 Mon Sep 17 00:00:00 2001 From: NTMQuannuaQMTN <74445798+NTMQuannuaQMTN@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:16:06 +0700 Subject: [PATCH] Update PowXN.java --- .../java/com/leetcode/arrays/binarysearch/PowXN.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/leetcode/arrays/binarysearch/PowXN.java b/src/main/java/com/leetcode/arrays/binarysearch/PowXN.java index 3591c50e..630f7bdc 100644 --- a/src/main/java/com/leetcode/arrays/binarysearch/PowXN.java +++ b/src/main/java/com/leetcode/arrays/binarysearch/PowXN.java @@ -74,12 +74,10 @@ public static double myPow(double x, int n) { } public static void main(String[] args) { - assertEquals(1024.0, myPowNaive(2.0, 10)); - assertEquals(0.25, myPowNaive(2.0, -2)); - assertEquals(0.0, myPowNaive(0.00001, 2147483647)); - - assertEquals(1024.0, myPow(2.0, 10)); - assertEquals(0.25, myPow(2.0, -2)); - assertEquals(0.0, myPow(0.00001, 2147483647)); + assertEquals(0.0, myPow(99.9, -2147483647)); + assertEquals(-0.0, myPow(-99.9, -2147483647)); + assertEquals(9.26100, myPow(2.10000, 3)); + assertEquals(0.25000, myPow(2.00000, -2)); + assertEquals(1024.0, myPow(2, 10)); } }