Skip to content

Builtin math ncr can be extremely slow #8170

@juntuu

Description

@juntuu

The math ncr function is extremely slow when given NAN and 1 as parameters.

This issue is also open on tinyexpr: codeplea/tinyexpr#62

$ time math 'ncr(0/0, 1)'
math: Error: Result is infinite
'ncr(0/0, 1)'

________________________________________________________
Executed in   16.87 secs    fish         external
   usr time   16.81 secs   16.81 secs    0.00 micros
   sys time    0.06 secs    0.06 secs    0.00 micros

This should be fixable by adding nan checks for the parameters of ncr.

fish, version 3.2.1-1-gb80964b6b

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that's not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions