You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The changes introduced with eace5e6 broke things like
Faker::Lorem.sentence(2,false,0)
Even though documentation says it should be possible
According to the Random documentation rand(max) returns a value between zero and max (not inclusive), and thus negative or zero are not valid parameters
There's a couple of ways to fix this and wanted to do it according to the project's recommendations before submitting a PR
Should the documentation be updated to reflect this (passing 1 to Random::DEFAULT.rand always returns zero (0)),
Should this behavior be fixed and allow for zero on rand, or at least the current method signatures that allow zero?
Thx
The text was updated successfully, but these errors were encountered:
I vote for keeping the existing documentation and (old) behavior by allowing zero in the arguments list and then handing Kernel.rand the passed argument + 1.
The changes introduced with eace5e6 broke things like
Even though documentation says it should be possible
According to the
Random
documentationrand(max)
returns a value between zero and max (not inclusive), and thus negative or zero are not valid parametersThere's a couple of ways to fix this and wanted to do it according to the project's recommendations before submitting a PR
Random::DEFAULT.rand
always returns zero (0)),Thx
The text was updated successfully, but these errors were encountered: