On Sun, Aug 11, 2024 at 2:45 PM Hakan Granath <hakan.gran...@gmail.com> wrote:
>

>     # We could also have a vertical line with two interior points
>     if x1 == x2:
>         return [M.get_point(x1), M.get_point(infinity)]
>
> Maybe the if statement should instead be something like
>
>     if abs(x1 - x2) < EPSILON:
>

This was discussed here last year:
https://groups.google.com/g/sage-devel/c/KwfbvDoi-yg

Security weakness CWE-1077: Floating Point Comparison with Incorrect Operator

https://cwe.mitre.org/data/definitions/1077.html

Numeric calculation using floating point values can generate imprecise
results because of rounding errors. As a result, two different
calculations might generate numbers that are mathematically equal, but
have slightly different bit representations that do not translate to
the same mathematically-equal values. As a result, an equality test or
other comparison might produce unexpected results.

This issue can prevent the product from running reliably. If the
relevant code is reachable by an attacker, then this reliability
problem might introduce a vulnerability.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAGUWgD-NBXwAS9drt-tH2rGsCPHG4D6-a2kDcduPVtaHR_W2KA%40mail.gmail.com.

Reply via email to