It's not so much a printing issue as an ease of manipulation issue.
In base 16 I can go:
In [30]: hex = "ee36"

In [31]: int(hex, 16)
Out[31]: 60982

In [32]: int(hex[0], 16)
Out[32]: 14

In [34]: int(hex[2], 16)
Out[34]: 3

I would like to be able to do that with any base, so I could say:
base1000 = base(1000, 34987563294875623489756324576)

if int(base1000[0], 1000) > 900: Do_Stuff()
...

I was doing a bunch of iterations using divmod to pull apart the
integers, but then I realized that conceptually what I was doing was
just change of base operations with really large bases, and so I think
I can really clean up my code a *lot* if I can figure out a way to do
this.  As far as printing goes, it isn't that important to me, because
once the base goes over 52 or so, things would start to get
incomprehensible (i.e.
e'k"rw12""34yf'4vw'e1234rkhfv'b124214"".124'5gew""rgsfv X 1000^-31)

Thanks,
--Connor


On Tue, Jun 22, 2010 at 12:13 AM, Ondrej Certik <ond...@certik.cz> wrote:
> On Mon, Jun 21, 2010 at 9:54 PM, John Connor
> <john.theman.con...@gmail.com> wrote:
>> Hello all,
>> I was wondering how sympy handles numbers with different bases
>> (positional notation)?  I would like to be able to convert a number
>> from any base to any base, but because 'base' means so many different
>> things in different contexts searching the docs / source has been
>> fruitless.  I am currently abusing pythons int(x[, base]) function,
>> but it only works with bases up to 32, and I need to be able to use
>> arbitrarily large bases.  Can sympy do this?  If someone could just
>> point me in the right direction with the source or docs I would
>> appreciate it very much.
>
> Is this just a printing issue? And a way to create new integers?
>
> Ondrej
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To post to this group, send email to sy...@googlegroups.com.
> To unsubscribe from this group, send email to 
> sympy+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/sympy?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to