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.
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. :)
Knight's Tour Checker
How to add?
Convert a vector into a number
Calculate Euler's phi function
The Dark Side of the Die
All flights lead to Idaho Falls
RSA encryption using public key
Number Theoretic Transform (NTT)
Determine the kth Primitive Root of Unity
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office