Skip to content

might want to clarify the usage of return type for lua_tonumber() #2

@poetaman

Description

@poetaman

In some places you use assign the return value of lua_tonumber() to int without a cast. That makes it unclear whether that is intentional or just a mistake... In other places you do assign lua_tonumber() to a lua_Number type.

The reason to be explicit: when you introduce lua_tonumber() around table 2.3, you mention of its return type being lua_Number. But in the referenced listing that is not visible (readers just see int), and there is no comment about the cast.

Also, is there a reason to not use lua_tointeger() and corresponding lua_Integer?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions