Skip to content

[math] Documentation is misleading for function parameters #409

@jffaust

Description

@jffaust

I was looking to use the fit function from the math package. I looked at the documentation to understand how to use it.

image

The parameters of the function in the documentation are: a, b, c, d, e

And the documentation states that "Returns a number in the [c,d] interval which is relative to x in the [a,b] interval". I found it a bit weird that it specified the x parameter but all the others were valid so I thought the e parameter must be x.

I was getting really weird behavior in my code so I looked up the code of the function and x is actually the first parameter :O

This must be because of the Fn5 type used under the hood.

Taking a closer look at the help in my editor, I can see the the first parameter is x (@param x) but it's still quite confusing and impossible to know from the documentation site:

image

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