Talk:Sum digits of an integer: Difference between revisions

m
(→‎Output base: clarification of my changes)
Line 8:
:::254 in base 16 has the digits with decimal values 15 and 14. Their sum when expressed in decimal notation is 29. In base 16, using hexadecimal digits, this sum might be represented as 1d = f + e. But we should get a different value for the sum of the digits of 256 -- in base 16, the digits have decimal values 1, 0 and 0, so their sum should be 1. That said, the base used to express the result need not have anything to do with the base used to perform the calculation. --[[User:Rdm|Rdm]] 16:54, 23 July 2012 (UTC)
 
:::: I've rewritten “0xfe” to “<code>fe</code><sub><code>16</code></sub>” in the task description; the issue with it before was that “0xfe” is just an encoding of the number (in a way that happens to be a numeric constant in many languages) and not the number itself. In particular, “x” isn't a hex digit. –[[User:Dkf|Donal Fellows]] 08:55, 31 July 2012 (UTC)
Anonymous user