Skip to content

Conditional returns nil instead of 1 #77

@Veslo5

Description

@Veslo5

I have simple function with condition which should return number 1, but instead returns nil.

function clamp(x, min, max)
    return x < min and min or (x > max and max or x)
end

local x = clamp(0, 1, 25)
print(x) --nil

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions