On Apr 3, 7:37 am, Alex Ghitza <[EMAIL PROTECTED]> wrote:
> I guess this is a question of convention, and depends on how you think
> of "digit":
>
> (1) a digit is a symbol used to construct representations of numbers,
> and so the base 10 digits are: "0", "1", ..., "9".  In this case,
> 0.ndigits() should return 1 and 0.digits() should return [0]
>
> (2) when writing an integer n in base b, you compute a b-adic expansion
>         n = d_0 + d_1*b^1 + d_2*b^2 + ... + d_k b^k
> with d_k nonzero; you call the d_i the "digits" of a.  Then 0 *has no
> such expansion*, therefore 0.digits() should return [] and 0.ndigits()
> should return 0.

I have a slight preference for (2), but I would be happy either way as
long as everything is consistent and documented.

Carl
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to