Skip to content

Commit 14b6193

Browse files
committed
Changed return type of static method to long
1 parent 6391285 commit 14b6193

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎algorithms/roundUpToHundred/src/com/java/src/RoundUpToHundred.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ public static void main(String[] args) {
1212
RoundUpToHundred.round(input);
1313
}
1414

15-
static int round(double input) {
16-
int i = (int) Math.ceil(input);
15+
static long round(double input) {
16+
long i = (int) Math.ceil(input);
1717
return ((i + 99) / 100) * 100;
1818
};
1919

‎algorithms/roundUpToHundred/src/com/java/src/RoundUpToHundredTest.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
public class RoundUpToHundredTest {
88
@Test
9-
public void givenInput_whenRoundedUp_thenTrue() {
9+
public void givenInput_whenRound_thenRoundUpToTheNearestHundred() {
1010
assertEquals("Rounded up to hundred", 100, RoundUpToHundred.round(99));
1111
assertEquals("Rounded up to three hundred ", 300, RoundUpToHundred.round(200.2));
1212
assertEquals("Returns same rounded value", 400, RoundUpToHundred.round(400));

0 commit comments

Comments
 (0)