Skip to content

Commit fe4a349

Browse files
committed
added Javadoc comment
1 parent d48e121 commit fe4a349

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ch06/Series.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,22 @@ public static double absoluteValue(double x) {
6868
return area(distance(xc, yc, xp, yp));
6969
}
7070

71+
/**
72+
* Tests whether x is a single digit integer.
73+
*
74+
* @param x the integer to test
75+
* @return true if x has one digit, false otherwise
76+
*/
7177
public static boolean isSingleDigit(int x) {
72-
if (x >= 0 && x < 10) {
78+
if (x > -10 && x < 10) {
7379
return true;
7480
} else {
7581
return false;
7682
}
7783
}
7884

7985
public static boolean isSingleDigit2(int x) {
80-
return x >= 0 && x < 10;
86+
return x > -10 && x < 10;
8187
}
8288

8389
public static int factorial(int n) {

0 commit comments

Comments
 (0)