Issue with small floating point numbers

JG someone at somewhere.com
Thu May 13 04:17:16 UTC 2021


On Thursday, 13 May 2021 at 03:48:49 UTC, Tim wrote:
> On Thursday, 13 May 2021 at 03:46:28 UTC, Alain De Vos wrote:
>> Not is is not wrong it is wright.
>> Because you use not pi but an approximation of pi the result 
>> is not zero but an approximation of zero.
>
> Oh, of course. Jesus that sucks big time. Any idea on how to 
> use assert with an approximate number like this?

You could try and use this 
[this](https://dlang.org/library/std/math/is_close.html)


More information about the Digitalmars-d-learn mailing list