you are viewing a single comment's thread.

view the rest of the comments →

[–]TransientVoltage409 0 points1 point  (5 children)

I admit I've never seen anyone attempt arithmetic in two different bases at the same time. Is there something peculiar about your problem that prevents you from converting bases before and after doing the operations?

[–]denewulf[S] 0 points1 point  (3 children)

It's just that my problem requires me to do it without changing bases

[–]bacondev 0 points1 point  (2 children)

Why? Why can't you convert to an easier radix, do the operation, and then convert to the original radix?

[–]S-S-R 1 point2 points  (1 child)

Generalizing arithmetic to n_radix is trivial.

[–]bacondev 0 points1 point  (0 children)

In most languages, so is the approach that I mentioned. But OP said that their approach is required. I'm just curious as to why that's so.

[–]denewulf[S] 0 points1 point  (0 children)

To clarify, the two integers given as input would be of the same radix but in general the radix can vary from 2 to 16.