Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,15 @@
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1730331061132</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
13 changes: 7 additions & 6 deletions src/com/jwetherell/algorithms/numbers/Integers.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

public class Integers {

//Moved the global variables to the top to improve readabilty
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 BigDecimal ZERO = new BigDecimal(0);
private static final BigDecimal TWO = new BigDecimal(2);

Expand Down Expand Up @@ -137,12 +144,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();
int x = number;
Expand Down