Issue with small floating point numbers

Alain De Vos devosalain at ymail.com
Thu May 13 04:19:14 UTC 2021


I would calculate the squared distance to the point (-10,0) and 
check it is small enough for practical use.
```
double squared_distance=(p.x+10) * (p.x+10)+p.y * p.y
assert (squared_distance < 1e-10);

```


More information about the Digitalmars-d-learn mailing list