I claim that the Rust test case fn input_base_is_one()
is not mathematically correct. 1 is a perfectly good base for a number system, favoured by ancient tribes and pure mathematicians alike – the Unary number system.
The exercises aren’t all intended to be perfectly mathematically correct The purpose of the exercises is to give people a vehicle to practice programming. The exercise creators here opted to stick to values they felt were able to be represented using a decimal system which led them to using two as a minimum base. Note, this isn’t specific to Rust but to all the tracks. While this may not be “correct” from a mathematics perspective, this isn’t a bug per se but a design choice. This is also highly unlikely to change as that would break all existing solutions across all tracks.
Thanks for the fast response! Indeed, it is trickier than I imagined (as more of a mathematician than a programmer by training) to cover base 1 in the mathematical way without adding it as an additional special case.
And if you want to have even more fun when playing around:
You could add negative bases to the mix.
But I agree with Isaac, limiting the base to an integer greater than 1
is reasonable.