|
|
| version 1.9, 2025/05/05 22:52:32 | version 1.10, 2025/05/05 23:02:39 |
|---|---|
| Line 24 | Line 24 |
| * along with FreeM. If not, see <https://www.gnu.org/licenses/>. | * along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
| * | * |
| * $Log$ | * $Log$ |
| * Revision 1.10 2025/05/05 23:02:39 snw | |
| * More fixes around E notation | |
| * | |
| * Revision 1.9 2025/05/05 22:52:32 snw | * Revision 1.9 2025/05/05 22:52:32 snw |
| * Make E notation error message more appropriate | * Make E notation error message more appropriate |
| * | * |
| Line 47 | Line 50 |
| #include "mpsdef.h" | #include "mpsdef.h" |
| #include <stdlib.h> | #include <stdlib.h> |
| #include <math.h> | #include <math.h> |
| #include <ctype.h> | |
| int unit (char *str); | int unit (char *str); |
| extern void cond_round (char *a, int digits); /* defined in expr.c */ | extern void cond_round (char *a, int digits); /* defined in expr.c */ |
| Line 1981 int numlit (char *str) | Line 1985 int numlit (char *str) |
| } | } |
| if (expflg) { | if (expflg) { |
| if (ch == MINUS) { | if (ch == MINUS) { |
| if (str[i + 1] == '-') { | if (str[i + 1] == '-') { |
| merr_raise (INVEXPR); | |
| return (0); | |
| } | |
| if (!isdigit (str[i + 1])) { | |
| merr_raise (INVEXPR); | merr_raise (INVEXPR); |
| return (0); | return (0); |
| } | } |
| expflg = (-expflg); | expflg = (-expflg); |
| continue; | continue; |
| } | } |
| if (ch == PLUS) | if (ch == PLUS) { |
| if (str[i + 1] == '+') { | |
| merr_raise (INVEXPR); | |
| return (0); | |
| } | |
| if (!isdigit (str[i + 1])) { | |
| merr_raise (INVEXPR); | |
| return (0); | |
| } | |
| continue; | continue; |
| } | |
| } | } |
| if ((result = unit (&str[i]))) | if ((result = unit (&str[i]))) |
| ch = str[i] = EOL; | ch = str[i] = EOL; |