From 2f4516ffb97c589a52e92d2bf099a14125d4bbb7 Mon Sep 17 00:00:00 2001 From: welshowa <116571239+welshowa@users.noreply.github.com> Date: Wed, 30 Oct 2024 19:32:41 -0400 Subject: [PATCH] Larger values represented as constants at the top of the file --- src/com/jwetherell/algorithms/numbers/Integers.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/com/jwetherell/algorithms/numbers/Integers.java b/src/com/jwetherell/algorithms/numbers/Integers.java index fb86fd3d..4035c833 100644 --- a/src/com/jwetherell/algorithms/numbers/Integers.java +++ b/src/com/jwetherell/algorithms/numbers/Integers.java @@ -5,6 +5,12 @@ import java.util.Map; public class Integers { + private static final int BILLION = 1000000000; + private static final int MILLION = 1000000; + private static final int THOUSAND = 1000; + private static final int HUNDRED = 100; + private static final int TEN = 10; + //Larger values represented as constants private static final BigDecimal ZERO = new BigDecimal(0); private static final BigDecimal TWO = new BigDecimal(2); @@ -137,11 +143,6 @@ public static final boolean powerOfTwoUsingBits(int numberToCheck) { multiDigits.put(90,"ninety"); } - private static final int BILLION = 1000000000; - private static final int MILLION = 1000000; - private static final int THOUSAND = 1000; - private static final int HUNDRED = 100; - private static final int TEN = 10; private static final String handleUnderOneThousand(int number) { StringBuilder builder = new StringBuilder();