Coder Social home page Coder Social logo

Add a random() function about epsilon HOT 8 CLOSED

numworks avatar numworks commented on June 28, 2024 4
Add a random() function

from epsilon.

Comments (8)

mateoconlechuga avatar mateoconlechuga commented on June 28, 2024 1

Do we want functions such as randInt(), randNorm(), randBin(), along with a way to seed random numbers using a rand style variable? It would help match other calculator variants.

from epsilon.

Ecco avatar Ecco commented on June 28, 2024

a way to seed random numbers using a rand style variable

This could actually be a great opportunity to teach students the difference between pseudo-randomness and actual randomness. These two concepts have long been improperly mixed up :-) We could do both and give them appropriate names (e.g. random() and pseudoRandom() would seem like a great start).

from epsilon.

Grahack avatar Grahack commented on June 28, 2024

Hi,
Now that the Python app has the glorious >>> wouldn't it be easier and perhaps more useful to have the random module (or a smaller version). Or did you want to have random() in the calculation app?

from epsilon.

maxBzh avatar maxBzh commented on June 28, 2024

Hi,
I also want this for my students, when introducing simple statistics.
So I have compiled epsilon with support of Python library urandom (the random library of Micro Python). Works like a charm. I have the following random functions :

  • seed(int)
  • random() : float between 0 and 1
  • randInt(int start,int stop) : integer between start and stop
  • randrange(int stop, int start, int step) : integer between start and stop, search with step (start and stop not mandatory)
  • choice([a,b,c,...]) : choose item randomly in array [a,b,c,...]

Do I make a pull request for this ?

from epsilon.

Grahack avatar Grahack commented on June 28, 2024

@maxBzh Release early, release often! I'm interested, and I may not be the only one.

from epsilon.

maxBzh avatar maxBzh commented on June 28, 2024

@Grahack Here you go #295

from epsilon.

Ecco avatar Ecco commented on June 28, 2024

Thank you @maxBzh ! Definitely something we wanted to do so your PR is very much appreciated! Thank you very much!

from epsilon.

artaxxx avatar artaxxx commented on June 28, 2024

Fixed by #295 and #316

from epsilon.

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.