We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d48e121 commit fe4a349Copy full SHA for fe4a349
ch06/Series.java
@@ -68,16 +68,22 @@ public static double absoluteValue(double x) {
68
return area(distance(xc, yc, xp, yp));
69
}
70
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
+ */
77
public static boolean isSingleDigit(int x) {
- if (x >= 0 && x < 10) {
78
+ if (x > -10 && x < 10) {
79
return true;
80
} else {
81
return false;
82
83
84
85
public static boolean isSingleDigit2(int x) {
- return x >= 0 && x < 10;
86
+ return x > -10 && x < 10;
87
88
89
public static int factorial(int n) {
0 commit comments