The exact solution for 38.59 in base 15 is the repeating decimal 28.8cb3b3b3b3b3b3b3..., which means the given solution 28.8cb3b3b3b3b42d4a contains some "junk digits" at the end; it's not really fair to ask for those junk digits as opposed to any others. Also, it looks like trailing zeros are supposed to be removed, but some of the base 2 solutions contain a trailing zero.
Tim,
You are correct. Thanks for the comment. Fixed the errors you detected as well as a few others. Should be good now.
Hi David, nice problem but there are still I believe a few precision issues remaining in the testsuite. For example the number "7285.4" as a float can only be precisely encoded up to ~1e-12 (since eps(7285.4)=9.0949e-13), so its base-15 representation cannot be defined with 16-decimal places (as that would require >1e-19 precision). I believe perhaps you could fix that simply entering the input decimal numbers using chars, which would avoid any limited-precision issues? (or by relaxing the requirements to fewer decimal places)
Changed and fixed the problem. Input is now cell array of character arrays.
It seems the precision issues were indeed fixed. :)
Not sure what the problem was, but I changed #6 and added some additional test problems.
Oh, the problem was with my algorithm, sorry. I am indeed using python's long int (for multiplication of large integers), but I was relying on str2num for some operations (which apparently introduced floats back in my code). After removing it, it worked out fine.
PS: This new update knocked out some wrong solutions (including some of mine). Awesome. :)
6617 Solvers
506 Solvers
356 Solvers
214 Solvers
How many days does the cat take to climb out of the hole?
64 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!