Skip to content

Missing pattern matching for ComplexInf operations in Evaluate.fs #117

@diluculo

Description

@diluculo

I found missing matching patterns in several arithmetic functions in Evaluate.fs where operations with complex infinity aren't handled correctly, resulting in "not supported" errors instead of returning mathematically correct results.

The issue occurs when adding finite values to complex infinity (-1 + ComplexInf) or multiplying non-zero values with complex infinity. These operations should generally return ComplexInf but currently fail with errors.

I think the following may fix the missing patterns:

// in fadd function:
| ComplexInf, _ | _, ComplexInf -> ComplexInf 

// In fmultiply function:
| ComplexInf, Real 0.0 | Real 0.0, ComplexInf -> Undef  // 0 × ⧝ = undefined
| ComplexInf, _ | _, ComplexInf -> ComplexInf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions