Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.asIntPositive/Negative both true for 0 #103

Closed
joh-klein opened this issue Feb 27, 2020 · 1 comment · Fixed by #104 or #172
Closed

.asIntPositive/Negative both true for 0 #103

joh-klein opened this issue Feb 27, 2020 · 1 comment · Fixed by #104 or #172

Comments

@joh-klein
Copy link
Contributor

To quote from the docs:

asIntPositive()
Performs the same task as asInt(), but also verifies that the number is positive (greater than zero).

asIntNegative()
Performs the same task as asInt(), but also verifies that the number is negative (less than zero).

This is very close to what the Wikipedia entry says about integers with the important addition, that zero is neither:

An integer is positive if it is greater than zero and negative if it is less than zero. Zero is defined as neither negative nor positive.

But when I look in the code, here and here you specifically leave out 0 which makes it both positive and negative.

I actually don't mind that, I would only like it, if it said so in the docs :)

@evanshortiss
Copy link
Owner

@joh-klein included in v6.0.2 release 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants