diff options
author | Pixel <Pixel> | 2001-12-02 18:55:35 +0000 |
---|---|---|
committer | Pixel <Pixel> | 2001-12-02 18:55:35 +0000 |
commit | e4075153def021c3405accb19ffcdc3247d98807 (patch) | |
tree | dc7085d969af2dd121f22619d6c453c4bd7a41a9 /lib/String.cc | |
parent | 37989e882eaa805662dd0e260eb293c939e082b7 (diff) |
Comments and so...
Diffstat (limited to 'lib/String.cc')
-rw-r--r-- | lib/String.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/String.cc b/lib/String.cc index 60ca6df..d131fba 100644 --- a/lib/String.cc +++ b/lib/String.cc @@ -314,7 +314,7 @@ double String::datedif(const String & s) const { } bool String::is_number(void) const { - for (size_t i = ((str[i] == '-') ? 1 : 0); i < siz; i++) { + for (size_t i = ((str[0] == '-') ? 1 : 0); i < siz; i++) { if ((str[i] > '9') || (str[i] < '0')) return false; } return true; @@ -323,7 +323,7 @@ bool String::is_number(void) const { bool String::is_float(void) const { bool seendot = false; - for (size_t i = ((str[i] == '-') ? 1 : 0); i < siz; i++) { + for (size_t i = ((str[0] == '-') ? 1 : 0); i < siz; i++) { if ((str[i] > '9') || (str[i] < '0')) { if ((str[i] == '.') && !seendot) { seendot = true; |