** try to convert a value to an integer, rounding according to 'mode', ** without string coercion. ** ("Fast track" handled by macro 'tointegerns'.) */
| 147 | ** ("Fast track" handled by macro 'tointegerns'.) |
| 148 | */ |
| 149 | int luaV_tointegerns (const TValue *obj, lua_Integer *p, F2Imod mode) { |
| 150 | if (ttisfloat(obj)) |
| 151 | return luaV_flttointeger(fltvalue(obj), p, mode); |
| 152 | else if (ttisinteger(obj)) { |
| 153 | *p = ivalue(obj); |
| 154 | return 1; |
| 155 | } |
| 156 | else |
| 157 | return 0; |
| 158 | } |
| 159 | |
| 160 | |
| 161 | /* |
no test coverage detected