HarmonyIO / Validation

Asynchronous validation library
MIT License
5 stars 2 forks source link

Positive / negative rules for numeric values #11

Closed PeeHaa closed 5 years ago

PeeHaa commented 5 years ago

This brings up an interesting (at least for me) point. Do we want to treat 0 as neither positive / negative. Or as both positive / negative. Or as either one.

Do we want to treat signed and unsigned 0 differently?

PeeHaa commented 5 years ago

For our (probably) most used use case (data coming from user input) we will treat all values < 0 to be negative and all numbers of 0 and up to be positive.

If users want the more mathematically correct "0 is neither negative nor positive" they can either create a new rule or use a combination of min and max rules.