Skip to content

Builtin math ncr can be extremely slow #8170

Closed

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

Activity

  1. faho commented on Jul 26, 2021

    @faho
    Member

    Huh, cool!

  2. added
    bug
    on Jul 26, 2021
  3. added this to the fish 3.4.0 milestone on Jul 26, 2021
  4. added a commit that references this issue on Dec 12, 2021
  5. locked as resolved and limited conversation to collaborators on Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions