Again, good problem, but it would be better if base-10 or base-2 was adopted as a standard at the description
Hello, Rafael. Thank-you for the feedback. Each approach has pros and cons.
Using the same base for all numbers in the problem statement would make comparison easy at a glance, but the values would not all be exact.
The mixture of bases used in the problem statement means that exact values are used for all numbers; although the reader has some inconvenience to perform a conversion in order to compare magnitudes, there may be some more educational value in that, IMHO.
"The hard way to go about it, but it worked like a charm!" :-)
If you think this one is ugly (and I agree 100% it is!) you should have seen my first few attempts, which included using "typecast" to get the numbers as uint64s and trying to compare them that way. At least this one worked...eventually.
James, actually, it's interesting on Cody to get to see things from another point of view. Kudos for original thinking :-) —DIV
What digit is it?
SET (the card game)
Pi Estimate 1
Add all the numbers between two limits (inclusive)
Back to basics: throwing errors / exceptions
Just take it easy for a second or two!
The twelve days of Christmas
Code breaker, Part I: Operation Phoenix
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