Giter VIP home page Giter VIP logo

Comments (3)

Dakkers avatar Dakkers commented on July 28, 2024

I'll hopefully be working on this in the next while

from numbers.js.

Dakkers avatar Dakkers commented on July 28, 2024

so many other tests are failing. I thought it was just that one, it seemed to have been giving us the most problems but apparently that's not the case. I'm just going to skew the error bounds on the tests so that it has a better chance of passing. it may be hacky but random numbers are wonky so whatever.

from numbers.js.

LarryBattle avatar LarryBattle commented on July 28, 2024

I tried the latest code from master with your changes but it didn't really help to lower the error rate.

I think this is the real problem.
In order for the random functions to be testable, a predetermined seed value for the pseudo random number generator must be used.
Currently, there's no way to achieve this.

Here's one possible solution.
In the random module, add a setter for the random number generator instead of hard coding to Math.random().

I see two benefits here.

  1. Users could replace Math.random() with a cryptographic-grade random number generator.
  2. Test cases would become predictable.
    During testing, we could use an alternative to the plain old Math.random().
    Possible options:

I'll try to submit a pull request soon.

from numbers.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.