MCPcopy Index your code
hub / github.com/yuin/gopher-lua / CheckInt

Method CheckInt

auxlib.go:20–27  ·  view source on GitHub ↗
(n int)

Source from the content-addressed store, hash-verified

18}
19
20func (ls *LState) CheckInt(n int) int {
21 v := ls.Get(n)
22 if intv, ok := v.(LNumber); ok {
23 return int(intv)
24 }
25 ls.TypeError(n, LTNumber)
26 return 0
27}
28
29func (ls *LState) CheckInt64(n int) int64 {
30 v := ls.Get(n)

Callers 14

ipairsauxFunction · 0.80
TestCheckIntFunction · 0.80
mathLdexpFunction · 0.80
mathRandomFunction · 0.80
strCharFunction · 0.80
strRepFunction · 0.80
strSubFunction · 0.80
debugGetLocalFunction · 0.80
debugGetUpvalueFunction · 0.80
debugSetLocalFunction · 0.80
debugSetUpvalueFunction · 0.80
tableRemoveFunction · 0.80

Calls 2

GetMethod · 0.95
TypeErrorMethod · 0.95

Tested by 2

TestCheckIntFunction · 0.64
sleepFunction · 0.64