Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
yes
Approved by 🧙
rejected, 2 years idle
actually, #digit and #sum are two different methods, chained together. one of the beautiful things about Ruby!
i never knew of this #digit method, this is awesome!
very clever!
What do you think happens if a String argument is given? What is supposed to happen?
isnt it because you use
Math.round()
instead ofMath.floor()
for the mantissa ?reference solution sometimes gives incorrect result:
input : 107.88354150716061: expected '010000101101011111000100011' to equal '010000101101011111000100010'
input : 925.3339639566982: expected '010001000110011101010101011' to equal '010001000110011101010101010'
I think random number should be rounded to 6 or 7 digits first. Reference solution could be build on DataView or on other solution.
This comment is hidden because it contains spoiler information about the solution
Thanks :)
Function name should use
snake_case
Description code blocks should be fixed as well (
snake_case
thingRuby 3.0 should be enabled with RSpec used
assertion messages should be added
This comment is hidden because it contains spoiler information about the solution
added random tests
can you update it to
3.0
?Loading more items...