ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 13 Jan 2020 23:24:53 +0100Unable to convert string to rational when plus sign is addedhttps://ask.sagemath.org/question/49537/unable-to-convert-string-to-rational-when-plus-sign-is-added/This looks like a bug. The code
QQ('+1')
gives the exception
> TypeError: unable to convert '+1' to a
> rational
This happens with any positive rational, not just 1.
Also, this does not happen with neither
ZZ('+1')
nor
PolynomialRing(QQ,names='x')('+1')
Is this actually a bug? If it is, can someone investigate it and write a trac ticket? I'm quite new to Sagemath and Python and quite unskilled yet to do it properly. Thank you!Jose BroxMon, 13 Jan 2020 23:24:53 +0100https://ask.sagemath.org/question/49537/Weird behaviour/bug with pi and rational exponentshttps://ask.sagemath.org/question/46390/weird-behaviourbug-with-pi-and-rational-exponents/When I type this:
print numerical_approx((4/pi())^(2/1))
print numerical_approx((4/3.14159265358979)^(2/1))
I get
sage: 3.90303389783585e2585827972
1.62113893827741
(note the letter "e" in the 1st line)
This happens on my notebook, on the COCALC server there is a crash.
Has anyone else seen this ? What is the problem there ?kenJ0428Sun, 28 Apr 2019 15:50:23 +0200https://ask.sagemath.org/question/46390/