diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-06-11 15:21:37 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1998-06-11 15:21:37 -0300 |
commit | 1917149fdd737752451da2c5f2dfbe1adde72c20 (patch) | |
tree | 1c83b21cc75169b984ef2900f48f5c608c99c7d3 | |
parent | 0845e73b6a374bd8eb2969a91ade56cb0407b929 (diff) | |
download | lua-1917149fdd737752451da2c5f2dfbe1adde72c20.tar.gz lua-1917149fdd737752451da2c5f2dfbe1adde72c20.tar.bz2 lua-1917149fdd737752451da2c5f2dfbe1adde72c20.zip |
details.
-rw-r--r-- | lobject.h | 7 | ||||
-rw-r--r-- | lvm.c | 4 |
2 files changed, 8 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.h,v 1.18 1998/03/09 21:49:52 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 1.19 1998/05/18 22:26:03 roberto Exp roberto $ |
3 | ** Type definitions for Lua objects | 3 | ** Type definitions for Lua objects |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -32,6 +32,11 @@ | |||
32 | #define LUA_NUM_TYPE double | 32 | #define LUA_NUM_TYPE double |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | /* | ||
36 | ** format to convert number to strings | ||
37 | */ | ||
38 | #define NUMBER_FMT "%g" | ||
39 | |||
35 | typedef LUA_NUM_TYPE real; | 40 | typedef LUA_NUM_TYPE real; |
36 | 41 | ||
37 | #define Byte lua_Byte /* some systems have Byte as a predefined type */ | 42 | #define Byte lua_Byte /* some systems have Byte as a predefined type */ |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 1.28 1998/03/30 13:57:23 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 1.29 1998/05/31 22:18:24 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -75,7 +75,7 @@ int luaV_tostring (TObject *obj) | |||
75 | if ((real)(-MAX_INT) <= f && f <= (real)MAX_INT && (real)(i=(int)f) == f) | 75 | if ((real)(-MAX_INT) <= f && f <= (real)MAX_INT && (real)(i=(int)f) == f) |
76 | sprintf (s, "%d", i); | 76 | sprintf (s, "%d", i); |
77 | else | 77 | else |
78 | sprintf (s, "%g", (double)nvalue(obj)); | 78 | sprintf (s, NUMBER_FMT, nvalue(obj)); |
79 | tsvalue(obj) = luaS_new(s); | 79 | tsvalue(obj) = luaS_new(s); |
80 | ttype(obj) = LUA_T_STRING; | 80 | ttype(obj) = LUA_T_STRING; |
81 | return 0; | 81 | return 0; |