** try to convert a value to an integer, rounding according to 'mode', ** without string coercion. ** ("Fast track" handled by macro 'tointegerns'.) */
| 135 | ** ("Fast track" handled by macro 'tointegerns'.) |
| 136 | */ |
| 137 | int luaV_tointegerns (const TValue *obj, lua_Integer *p, F2Imod mode) { |
| 138 | if (ttisfloat(obj)) |
| 139 | return luaV_flttointeger(fltvalue(obj), p, mode); |
| 140 | else if (ttisinteger(obj)) { |
| 141 | *p = ivalue(obj); |
| 142 | return 1; |
| 143 | } |
| 144 | else |
| 145 | return 0; |
| 146 | } |
| 147 | |
| 148 | |
| 149 | /* |
no test coverage detected