Skip to content

Commit dbf0f4c

Browse files
committed
Fixed support for scientific notation numbers
with negative exponents
1 parent 3a30a17 commit dbf0f4c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

main.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ bool isNumber(char* input){
7171
int numbersCount = 0;
7272
int exponentialCount = 0;
7373
while (input[i] != 0){
74-
if (input[i] == '-' && i != 0){
75-
return false;
74+
if (input[i] == '-' && (i != 0)){
75+
if (input[i-1] != 'e'){
76+
return false;
77+
}
7678
}
7779
if (input[i] == '.'){
7880
++decimalCount;

0 commit comments

Comments
 (0)