[Ironruby-core] Fwd: BigInteger.ToString(int radix)

Pete Bacon Darwin bacondarwin at googlemail.com
Mon Nov 19 04:26:57 EST 2007


This never seemed to appear on the list...

---------- Forwarded message ----------
From: Peter Bacon Darwin <bacondarwin at googlemail.com>
Date: 17 Nov 2007 21:43
Subject: BigInteger.ToString(int radix)
To: ironruby-core at rubyforge.org

 Hi, Just a quick question.

When BigInteger converts a string in a specific base, the letters it outputs
are upper case.  In MRI the letters are in lower case.  Is there a specific
reason for them to be in uppercase in BigInteger - for instance does
IronPython use uppercase?



Would it be acceptable to change the

        private static void AppendRadix(uint rem, uint radix, char[] tmp,
StringBuilder buf, bool leadingZeros) {

            const string symbols = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";



to

        private static void AppendRadix(uint rem, uint radix, char[] tmp,
StringBuilder buf, bool leadingZeros) {

            const string symbols = "0123456789abcdefghijklmnopqrstuvwxyz";



Alternatively, the down casing could be done in the Bignum.to_s(radix)
method but this seems wasteful.

Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/ironruby-core/attachments/20071119/c4ce2fe3/attachment.html 


More information about the Ironruby-core mailing list