aboutsummaryrefslogtreecommitdiff
path: root/lauxlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-07-17 09:30:53 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-07-17 09:30:53 -0300
commit8bb272a3e3d0693a1d587cfa3469153978ae617f (patch)
treec3a87e37c1921fcd27433036b84e500e0dc6735f /lauxlib.c
parentc229ed597f939eacfe1e9b7113e2a082fe93a3ae (diff)
downloadlua-8bb272a3e3d0693a1d587cfa3469153978ae617f.tar.gz
lua-8bb272a3e3d0693a1d587cfa3469153978ae617f.tar.bz2
lua-8bb272a3e3d0693a1d587cfa3469153978ae617f.zip
new conversion float->integer: conversion is valid only when
float has an exact representation as an integer
Diffstat (limited to 'lauxlib.c')
-rw-r--r--lauxlib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lauxlib.c b/lauxlib.c
index 563362e5..263d9f80 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.c,v 1.264 2014/06/26 17:25:11 roberto Exp roberto $ 2** $Id: lauxlib.c,v 1.265 2014/07/16 14:51:36 roberto Exp roberto $
3** Auxiliary functions for building Lua libraries 3** Auxiliary functions for building Lua libraries
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -396,8 +396,8 @@ LUALIB_API lua_Number luaL_optnumber (lua_State *L, int arg, lua_Number def) {
396 396
397 397
398static void interror (lua_State *L, int arg) { 398static void interror (lua_State *L, int arg) {
399 if (lua_type(L, arg) == LUA_TNUMBER) 399 if (lua_isnumber(L, arg))
400 luaL_argerror(L, arg, "float value out of integer range"); 400 luaL_argerror(L, arg, "number has no integer representation");
401 else 401 else
402 tag_error(L, arg, LUA_TNUMBER); 402 tag_error(L, arg, LUA_TNUMBER);
403} 403}