valit-stack / Valit

Valit is dead simple validation for .NET Core. No more if-statements all around your code. Write nice and clean fluent validators instead!
MIT License
322 stars 26 forks source link

Support for Infinity on float and double #33

Open GooRiOn opened 7 years ago

GooRiOn commented 7 years ago

We should consider validation for Infinity in double and float. It might be tricky and honestly I don't know how how rules are implemented in C#. It's not super important imho.

arekbal commented 7 years ago

It is only important with our epsilon calculations and subtraction(#32). I guess we cannot do 3.f - Single.PositiveInfinity or a reverse of this operation. Algorithm for this should just check values before doing subtraction. Oh... and Math.Abs(Single.NegativeInfinity) does what? returns positive? :D

dbarwikowski commented 6 years ago

@arekbal returns 'Application encountered unexpected operation and needs to restart your operating system'

arekbal commented 6 years ago

returns Positive :)