GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — added Javadoc comment · jayaprabhakar/ThinkJavaCode@fe4a349

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • ch06
    • Series.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎ch06/Series.java‎

Copy file name to clipboardExpand all lines: ch06/Series.java
+8-2Lines 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 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.