Quantcast
Channel: Fluent Assertions
Viewing all articles
Browse latest Browse all 1402

New Post: Floating point precision

$
0
0

Sounds like a good idea. You shouldn't be able to compare floating point values anyway.

It is a breaking change though, because your proposal won't work. People expect the Be() to do the actual checking, but the Within() is required to determine the precision.

It should be something like this, though I don't particularly like this.

angleOfAttack.Should().BeWithin(35.4, 0.2)

Any better ideas?


Viewing all articles
Browse latest Browse all 1402

Trending Articles