diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-07-17 09:30:53 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-07-17 09:30:53 -0300 |
commit | 8bb272a3e3d0693a1d587cfa3469153978ae617f (patch) | |
tree | c3a87e37c1921fcd27433036b84e500e0dc6735f /lauxlib.c | |
parent | c229ed597f939eacfe1e9b7113e2a082fe93a3ae (diff) | |
download | lua-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.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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 | ||
398 | static void interror (lua_State *L, int arg) { | 398 | static 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 | } |