瀏覽代碼

number type in Lua changed for double (by default).

Roberto Ierusalimschy 27 年之前
父節點
當前提交
054e0b888a
共有 4 個文件被更改,包括 12 次插入9 次删除
  1. 4 3
      lobject.h
  2. 2 2
      lua.h
  3. 3 1
      makefile
  4. 3 3
      manual.tex

+ 4 - 3
lobject.h

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: lobject.h,v 1.17 1998/03/06 16:54:42 roberto Exp $
+** $Id: lobject.h,v 1.18 1998/03/09 21:49:52 roberto Exp roberto $
 ** Type definitions for Lua objects
 ** Type definitions for Lua objects
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -28,10 +28,11 @@
 ** "real" is the type "number" of Lua
 ** "real" is the type "number" of Lua
 ** GREP LUA_NUMBER to change that
 ** GREP LUA_NUMBER to change that
 */
 */
-#ifndef real
-#define real float
+#ifndef LUA_NUM_TYPE
+#define LUA_NUM_TYPE double
 #endif
 #endif
 
 
+typedef LUA_NUM_TYPE real;
 
 
 #define Byte lua_Byte	/* some systems have Byte as a predefined type */
 #define Byte lua_Byte	/* some systems have Byte as a predefined type */
 typedef unsigned char  Byte;  /* unsigned 8 bits */
 typedef unsigned char  Byte;  /* unsigned 8 bits */

+ 2 - 2
lua.h

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: lua.h,v 1.16 1998/03/06 16:54:42 roberto Exp roberto $
+** $Id: lua.h,v 1.17 1998/03/06 18:47:42 roberto Exp roberto $
 ** Lua - An Extensible Extension Language
 ** Lua - An Extensible Extension Language
 ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil
 ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil
 ** e-mail: [email protected]
 ** e-mail: [email protected]
@@ -43,7 +43,7 @@
 #ifndef lua_h
 #ifndef lua_h
 #define lua_h
 #define lua_h
 
 
-#define LUA_VERSION	"Lua 3.1 (alpha)"
+#define LUA_VERSION	"Lua 3.1"
 #define LUA_COPYRIGHT	"Copyright (C) 1994-1998 TeCGraf"
 #define LUA_COPYRIGHT	"Copyright (C) 1994-1998 TeCGraf"
 #define LUA_AUTHORS 	"W. Celes, R. Ierusalimschy & L. H. de Figueiredo"
 #define LUA_AUTHORS 	"W. Celes, R. Ierusalimschy & L. H. de Figueiredo"
 
 

+ 3 - 1
makefile

@@ -1,5 +1,5 @@
 #
 #
-## $Id: makefile,v 1.9 1998/01/02 17:46:32 roberto Exp roberto $
+## $Id: makefile,v 1.10 1998/01/05 17:12:54 roberto Exp roberto $
 ## Makefile
 ## Makefile
 ## See Copyright Notice in lua.h
 ## See Copyright Notice in lua.h
 #
 #
@@ -17,6 +17,8 @@
 #
 #
 # define LUA_COMPAT2_5 if yous system does need to be compatible with
 # define LUA_COMPAT2_5 if yous system does need to be compatible with
 # version 2.5 (or older)
 # version 2.5 (or older)
+#
+#define LUA_NUM_TYPE if you need numbers to be different from double
 
 
 CONFIG = -DPOPEN -D_POSIX_SOURCE
 CONFIG = -DPOPEN -D_POSIX_SOURCE
 #CONFIG = -DLUA_COMPAT2_5 -DOLD_ANSI -DDEBUG
 #CONFIG = -DLUA_COMPAT2_5 -DOLD_ANSI -DDEBUG

+ 3 - 3
manual.tex

@@ -1,4 +1,4 @@
-% $Id: manual.tex,v 1.7 1998/03/30 18:17:55 roberto Exp roberto $
+% $Id: manual.tex,v 1.8 1998/04/02 16:09:16 roberto Exp roberto $
 
 
 \documentstyle[fullpage,11pt,bnf]{article}
 \documentstyle[fullpage,11pt,bnf]{article}
 
 
@@ -38,7 +38,7 @@ Waldemar Celes
 \tecgraf\ --- Computer Science Department --- PUC-Rio
 \tecgraf\ --- Computer Science Department --- PUC-Rio
 }
 }
 
 
-\date{\small \verb$Date: 1998/03/30 18:17:55 $}
+\date{\small \verb$Date: 1998/04/02 16:09:16 $}
 
 
 \maketitle
 \maketitle
 
 
@@ -235,7 +235,7 @@ There are six \Index{basic types} in Lua: \Def{nil}, \Def{number},
 \Def{string}, \Def{function}, \Def{userdata}, and \Def{table}.
 \Def{string}, \Def{function}, \Def{userdata}, and \Def{table}.
 \emph{Nil} is the type of the value \nil,
 \emph{Nil} is the type of the value \nil,
 whose main property is to be different from any other value.
 whose main property is to be different from any other value.
-\emph{Number} represents real (floating-point) numbers,
+\emph{Number} represents real (floating-point with double precision) numbers,
 while \emph{string} has the usual meaning;
 while \emph{string} has the usual meaning;
 notice that Lua is \Index{eight-bit clean},
 notice that Lua is \Index{eight-bit clean},
 and so strings can contain any ISO character,
 and so strings can contain any ISO character,