Re: [sympy] Convert between numeral systems

2017-06-29 Thread Robert Pollak
Am 2017-06-29 um 21:11 schrieb Chris Smith:
> Most of what you would need to convert strings to fractions in a given
> base is already part of Python and an example is given here
> 

Thank you, but I am not interested in fractions. I need floating point
representation in different bases.

Since I was already at stackoverflow, I poked around a little, and I
finally found something!:
"How to convert floating point number to base 3 in python",
https://stackoverflow.com/a/5111205/1389680

--Robert

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/e4db0524-1d2f-b1f4-6e43-454d36dc2f87%40posteo.net.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] Convert between numeral systems

2017-06-29 Thread Chris Smith
Most of what you would need to convert strings to fractions in a given base 
is already part of Python and an example is given here 


On Tuesday, September 1, 2015 at 11:26:48 AM UTC-5, Robert Pollak wrote:
>
>
>
> On Friday, July 17, 2015 at 11:20:15 PM UTC+2, Chris Smith wrote:
>>
>> Is this what you are looking for?
>>
>> >>> from sympy.ntheory.factor_ import digits
>> >>> digits(1234,20)
>> [20, 3, 1, 14]
>>
>
> Thank you! So there really was something hidden in SymPy :) Unfortunately, 
> as this is part of ntheory, it also cannot convert floats.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/789a3ca1-b8ba-4756-b99b-9804dad76150%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] MPZ related error: where to start investigations?

2017-06-29 Thread Isuru Fernando
On Thu, Jun 29, 2017 at 5:43 PM, Antoine Falaize 
wrote:

> Thank you for your investigations!
>
> So, as far as I understand: this error is related to the use of the mpmath
> gmpy backend, and has been corrected.
>
> But, currently, this makes a large part of pyphs unusable for a small set
> of platforms, and I do not understand:
> (i) the reason for certain platforms to raise this error, while other
> won't (we never explicitely specify any backend in pyphs, and do not point
> any specific version of sympy);
>

This happens when gmpy is installed only. (SymPy detects whether gmpy is
installed and uses gmpy)


> (ii) if this fix is already merged in the current sympy master, or if it
> will be in a future release.
>

This is fixed in sympy master and will be in the next release

Isuru Fernando

>
> Can we do anything to help?
>
>
> Le mercredi 28 juin 2017 21:57:54 UTC+2, Aaron Meurer a écrit :
>>
>> I don't think the fix was accidental. See
>> https://github.com/sympy/sympy/pull/11862/commits/8a7e079920
>> 35f05780ebc33b4ffbf72d32a83069.
>> From the commit message, "Also modify mpf_norm to handle non-mpz input
>> when the mpmath gmpy backend is
>> used."
>>
>> Your Point example doesn't fail for me in master.
>>
>> Aaron Meurer
>>
>> On Wed, Jun 28, 2017 at 8:02 AM, Isuru Fernando 
>> wrote:
>> > From reproduce I meant a similar error (didn't check pyphs)
>> >
>> > from sympy import Point
>> > import pickle
>> > pickle.loads(pickle.dumps(Point(1.1, 2.1).evalf()))
>> >
>> >
>> > Isuru Fernando
>> >
>> > On Wed, Jun 28, 2017 at 5:28 PM, Isuru Fernando 
>> wrote:
>> >>
>> >> I can reproduce with gmpy2 and sympy=1.0, but goes away if I remove
>> gmpy2
>> >> or update to sympy master. This was fixed accidentally in
>> >> https://github.com/sympy/sympy/pull/11862
>> >>
>> >>
>> >> Isuru Fernando.
>> >
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "sympy" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> an
>> > email to sympy+un...@googlegroups.com.
>> > To post to this group, send email to sy...@googlegroups.com.
>> > Visit this group at https://groups.google.com/group/sympy.
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msgid/sympy/CA%2B01voM9aDxDcb5HP
>> 8vRbj8jFpDXT3wm7KMo0RV2SqeHB7bm5w%40mail.gmail.com.
>> >
>> > For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/sympy/c3651984-89af-42e7-bf5c-b6e0ce367dc1%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CA%2B01voOZs6DAOpPeGXcn3hbmhd6iSMs9eYv8i2oa33LkSZbG%2BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [sympy] MPZ related error: where to start investigations?

2017-06-29 Thread Antoine Falaize
Thank you for your investigations!

So, as far as I understand: this error is related to the use of the mpmath 
gmpy backend, and has been corrected.

But, currently, this makes a large part of pyphs unusable for a small set 
of platforms, and I do not understand:
(i) the reason for certain platforms to raise this error, while other won't 
(we never explicitely specify any backend in pyphs, and do not point any 
specific version of sympy);
(ii) if this fix is already merged in the current sympy master, or if it 
will be in a future release.

Can we do anything to help?


Le mercredi 28 juin 2017 21:57:54 UTC+2, Aaron Meurer a écrit :
>
> I don't think the fix was accidental. See 
>
> https://github.com/sympy/sympy/pull/11862/commits/8a7e07992035f05780ebc33b4ffbf72d32a83069.
>  
>
> From the commit message, "Also modify mpf_norm to handle non-mpz input 
> when the mpmath gmpy backend is 
> used." 
>
> Your Point example doesn't fail for me in master. 
>
> Aaron Meurer 
>
> On Wed, Jun 28, 2017 at 8:02 AM, Isuru Fernando  > wrote: 
> > From reproduce I meant a similar error (didn't check pyphs) 
> > 
> > from sympy import Point 
> > import pickle 
> > pickle.loads(pickle.dumps(Point(1.1, 2.1).evalf())) 
> > 
> > 
> > Isuru Fernando 
> > 
> > On Wed, Jun 28, 2017 at 5:28 PM, Isuru Fernando  > wrote: 
> >> 
> >> I can reproduce with gmpy2 and sympy=1.0, but goes away if I remove 
> gmpy2 
> >> or update to sympy master. This was fixed accidentally in 
> >> https://github.com/sympy/sympy/pull/11862 
> >> 
> >> 
> >> Isuru Fernando. 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "sympy" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to sympy+un...@googlegroups.com . 
> > To post to this group, send email to sy...@googlegroups.com 
> . 
> > Visit this group at https://groups.google.com/group/sympy. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/sympy/CA%2B01voM9aDxDcb5HP8vRbj8jFpDXT3wm7KMo0RV2SqeHB7bm5w%40mail.gmail.com.
>  
>
> > 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/c3651984-89af-42e7-bf5c-b6e0ce367dc1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.