diff options
-rw-r--r-- | lobject.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.c,v 1.20 1999/08/16 20:52:00 roberto Exp roberto $ | 2 | ** $Id: lobject.c,v 1.21 1999/09/06 13:55:09 roberto Exp roberto $ |
3 | ** Some generic functions over Lua objects | 3 | ** Some generic functions over Lua objects |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -130,10 +130,10 @@ int luaO_str2d (const char *s, real *result) { /* LUA_NUMBER */ | |||
130 | } | 130 | } |
131 | while (isspace((unsigned char)*s)) s++; | 131 | while (isspace((unsigned char)*s)) s++; |
132 | if (*s != '\0') return 0; /* invalid trailing characters? */ | 132 | if (*s != '\0') return 0; /* invalid trailing characters? */ |
133 | if (point > 0) | 133 | if (point != 0) { |
134 | a /= expten(point); | 134 | if (point > 0) a /= expten(point); |
135 | else if (point < 0) | 135 | else a *= expten(-point); |
136 | a *= expten(-point); | 136 | } |
137 | *result = a; | 137 | *result = a; |
138 | return 1; | 138 | return 1; |
139 | } | 139 | } |