Skip to content

Commit 96bbfcc

Browse files
committed
tonumber() and tostring() [TO SQUASH]
1 parent 6e14ec7 commit 96bbfcc

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

tests/lapi/builtin_tonumber_test.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ https://github.com/LuaJIT/LuaJIT/pull/558
2121
Synopsis: tonumber(e [, base])
2222
]]
2323

24+
--[[
25+
TODO:
26+
n = tonumber(cdata)
27+
Converts a number cdata object to a double and returns it as a Lua
28+
number. This is particularly useful for boxed 64 bit integer
29+
values. Caveat: this conversion may incur a precision loss.
30+
]]
31+
2432
local luzer = require("luzer")
2533
local test_lib = require("lib")
2634
local MAX_INT = test_lib.MAX_INT

tests/lapi/builtin_tostring_test.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ https://www.lua.org/manual/5.1/manual.html
88
Synopsis: tostring(e)
99
]]
1010

11+
--[[
12+
TODO:
13+
s = tostring(cdata)
14+
Returns a string representation of the value of 64 bit integers
15+
("nnnLL" or "nnnULL") or complex numbers ("re±imi").
16+
]]
17+
1118
local luzer = require("luzer")
1219
local test_lib = require("lib")
1320
local MAX_INT = test_lib.MAX_INT

0 commit comments

Comments
 (0)