Skip to content

[BUG]: quantile function of Beta distribution fails in production build with Next.js #3011

Open

Description

Description

I have an application written in Next.js and some code that uses beta distribution from '@stdlib/stats-base-dists/dist'. I noticed that the quantile function is completely broken while building the application in production mode (next build && next start). For example the output in Chrome console:

> dist = new window.beta_test.Beta(5, 5) // I did an ugly hack window.beta_test = beta in the code
w {}
> dist.quantile(0.1)
0.9999999996744877
> dist.quantile(0.5)
4.6663115970492885e-302

The quantile function works as expected if I run the application in the development mode (next dev)

> dist = new window.beta_test.Beta(5, 5)
t {}
> dist.quantile(0.1)
0.30096876359321467
> dist.quantile(0.5)
0.5

I'm not sure if this is the case with other distributions

Related Issues

Related issues # , # , and # .

Questions

No.

Demo

No response

Reproduction

  • a
  • b
  • c

Expected Results

No response

Actual Results

No response

Version

0.2.2

Environments

Chrome

Browser Version

129.0.6668.91

Node.js / npm Version

No response

Platform

MacOS

Checklist

  • Read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working.Needs DiscussionNeeds further discussion.StatisticsIssue or pull request related to statistical functionality.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions