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.
duplicate
https://www.codewars.com/kata/5260074c9a0022f83e0009da
This kata is not Python 3 compliant.
The argument name of
Fraction.fromDecimal
shouldn't really befraction
, it should bedecimal
.No random test of JS/Python/Java.
This comment is hidden because it contains spoiler information about the solution
Needs random tests.
Must be as you say - I copied what I had and reset and was able to move on. Thanks for getting back to me.
It's probably terminology from another language than JavaScript.
I'm getting confused here as well - I don't see a test case you mentioned :) maybe you have edited it yourself in your test suite by accident?
Good chance I am getting confused here, but this test doesn't appear to be correct to me.
"Test.assertEquals(new Fraction(5, 3).add(new Fraction(1, 3)).toString(), '2/3', 'Proper addition was expected');"
I am reading that as 5 thirds (5/3) + 1 third (1/3). To me the answer should be 6 thirds (6/3) OR 2 wholes (2).
Am I getting this wrong?
Glad I saw this, was confused as to why I was getting "could not find symbol" errors in Java
Oh, and 169/1364 = 0.123900293255... and not 0.12390 :)
Well, 1.(9) = 2 and 0.123(9) is, in fact, equal to 0.124, while 0.12390 you suggested is 0.000(9) less :)
I think you don't really understand repeating decimals. Please refer to e.g. wikipedia: https://en.wikipedia.org/wiki/Repeating_decimal#Converting_repeating_decimals_to_fractions
ey.. why 1.(9) is 2 and 0.123(9) is 31/250 [is really 0.124]and not 169/1364 [is really 0.12390] that is closer
are these presicion problems? i though that you want to avoid them? base in the first problem of the serie
or there are tricky inputs
Better to use Euclidean algorithm to find gcd
Loading more items...