1 | initial version |
When you write sqrt(8.0)
, Sage calls the sqrt
method of the floating-point number 8.0 (an element of RR
). Hence you get a floating-point number. As you noticed, the sqrt
method for integers returns elements of the symbolic ring.
When you write 80.0 / pi
, Sage uses coercion (look at the manual for more details about this important concept in Sage) : it first searches for the common parent between floating-point 8.0
and symbolic \pi, which is the symbolic ring, it transforms the two elements in this parent, and does the division there. So, in that case,
8.0is first transformed into a symbolic
8.0|and then divided by the symbolic
pi`, which results in an element of the symbolic ring.
If you want the division between two floating-point numbers, and get a floating-point number, you can use the floating-point number version of $pi$, which is RR.pi()
:
sage: 8.0 / RR.pi()
2.54647908947033
2 | No.2 Revision |
When you write sqrt(8.0)
, Sage calls the sqrt
method of the floating-point number 8.0 (an element of RR
). Hence you get a floating-point number. As you noticed, the sqrt
method for integers returns elements of the symbolic ring.
When you write 80.0 / pi
, Sage uses coercion (look at the manual for more details about this important concept in Sage) : it first searches for the common parent between floating-point 8.0
and symbolic \pipi
, which is the symbolic ring, it transforms the two elements in this parent, and does the division there. So, in that case,case, 8.0
is first transformed into a symbolicsymbolic 8.0|
and then divided by the symbolicpi`, symbolic \pi
, which results in an element of the symbolic ring.
If you want the division between two floating-point numbers, and get a floating-point number, you can use the floating-point number version of $pi$, which is RR.pi()
:
sage: 8.0 / RR.pi()
2.54647908947033
3 | No.3 Revision |
When you write sqrt(8.0)
, Sage calls the sqrt
method of the floating-point number 8.0 (an element of RR
). Hence you get a floating-point number. As you noticed, the sqrt
method for integers returns elements of the symbolic ring.
When you write 80.0 / pi
, Sage uses coercion (look at the manual for more details about this important concept in Sage) : it first searches for the common parent between floating-point 8.0
and symbolic pi
, which is the symbolic ring, it transforms the two elements in this parent, and does the division there. So, in that case, 8.0
is first transformed into a symbolic
and then divided by the symbolic 8.0|8.0
, which results in an element of the symbolic ring.\pipi
If you want the division between two floating-point numbers, and get a floating-point number, you can use the floating-point number version of $pi$, $pi$,
which is isRR.pi()`:RR.pi()
:
sage: 8.0 / RR.pi()
2.54647908947033
4 | No.4 Revision |
When you write sqrt(8.0)
, Sage calls the sqrt
method of the floating-point number 8.0 (an element of RR
). Hence you get a floating-point number. As you noticed, the sqrt
method for integers returns elements of the symbolic ring.
When you write 80.0 / pi
, Sage uses coercion (look at the manual for more details about this important concept in Sage) : it first searches for the common parent between floating-point 8.0
and symbolic pi
, which is the symbolic ring, it transforms the two elements in this parent, and does the division there. So, in that case, 8.0
is first transformed into a symbolic 8.0
and then divided by the symbolic pi
, which results in an element of the symbolic ring.
If you want the division between two floating-point numbers, and get a floating-point number, you can use the floating-point number version of $$pi$, which pi$,
isRR.pi()`:is RR.pi()
:
sage: 8.0 / RR.pi()
2.54647908947033
5 | No.5 Revision |
When you write sqrt(8.0)
, Sage calls the sqrt
method of the floating-point number 8.0 (an element of RR
). Hence you get a floating-point number. As you noticed, noticed in your first example, the sqrt
method for integers returns elements of the symbolic ring.
When you write 80.0 / pi
, Sage uses coercion (look at the manual for more details about this important concept in Sage) : it first searches for the common parent between floating-point 8.0
and symbolic pi
, which is the symbolic ring, it transforms the two elements in this parent, and does the division there. So, in that case, 8.0
is first transformed into a symbolic 8.0
and then divided by the symbolic pi
, which results in an element of the symbolic ring.
If you want the division between two floating-point numbers, and get a floating-point number, you can use the floating-point number version of $pi$, which is RR.pi()
:
sage: 8.0 / RR.pi()
2.54647908947033
6 | No.6 Revision |
When you write sqrt(8.0)
, Sage calls the sqrt
method of the floating-point number 8.0 (an element of RR
). Hence you get a floating-point number. As you noticed in your first example, the sqrt
method for integers returns elements of the symbolic ring.
When you write 80.0 / pi
, Sage uses coercion (look at the manual for more details about this important concept in Sage) : it first searches for the common parent between floating-point 8.0
and symbolic pi
, which is the symbolic ring, it transforms the two elements in this parent, and does the division there. So, in that case, 8.0
is first transformed into a symbolic 8.0
and then divided by the symbolic pi
, which results in an element of the symbolic ring.
If you want the division between two floating-point numbers, and get a floating-point number, you can use the floating-point number version of $pi$, which is RR.pi()
:
sage: 8.0 / RR.pi()
2.54647908947033
7 | No.7 Revision |
When you write sqrt(8.0)
, Sage calls the sqrt
method of the floating-point number 8.0 (an element of RR
). Hence you get a floating-point number. As you noticed in your first example, the sqrt
method for (non square) integers returns elements of the symbolic ring.
When you write 80.0 / pi
, Sage uses coercion (look at the manual for more details about this important concept in Sage) : it first searches for the common parent between floating-point 8.0
and symbolic pi
, which is the symbolic ring, it transforms the two elements in this parent, and does the division there. So, in that case, 8.0
is first transformed into a symbolic 8.0
and then divided by the symbolic pi
, which results in an element of the symbolic ring.
If you want the division between two floating-point numbers, and get a floating-point number, you can use the floating-point number version of $pi$, which is RR.pi()
:
sage: 8.0 / RR.pi()
2.54647908947033
8 | No.8 Revision |
When you write sqrt(8.0)
, Sage calls the sqrt
method of the floating-point number 8.0 (an element of RR
). Hence you get a floating-point number. As you noticed in your first example, the sqrt
method for (non square) integers returns elements of the symbolic ring.ring SR
.
When you write 80.0 / pi
, Sage uses coercion (look at the manual for more details about this important concept in Sage) : it first searches for the common parent between floating-point 8.0
and symbolic pi
, which is the symbolic ring, it transforms the two elements in this parent, and does the division there. So, in that case, 8.0
is first transformed into a symbolic 8.0
and then divided by the symbolic pi
, which results in an element of the symbolic ring.
If you want the division between two floating-point numbers, and get a floating-point number, you can use the floating-point number version of $pi$, which is RR.pi()
:
sage: 8.0 / RR.pi()
2.54647908947033
Note that pi
is nothing else than SR.pi()
, you can redefine pi = RR.pi()
if you want to type things more easily.
9 | No.9 Revision |
When you write sqrt(8.0)
, Sage calls the sqrt
method of the floating-point number 8.0 (an element of RR
). Hence you get a floating-point number. As you noticed in your first example, the sqrt
method for (non square) integers returns elements of the symbolic ring SR
.
When you write 80.0 / pi
, Sage uses coercion (look at the manual for more details about this important concept in Sage) : it first searches for the common parent between floating-point 8.0
and symbolic pi
, which is the symbolic ring, it transforms the two elements in this parent, and does the division there. So, in that case, 8.0
is first transformed into a symbolic 8.0
and then divided by the symbolic pi
, which results in an element of the symbolic ring.
If you want the division between two floating-point numbers, and get a floating-point number, you can use the floating-point number version of $pi$, $\pi$, which is RR.pi()
:
sage: 8.0 / RR.pi()
2.54647908947033
Note that pi
is nothing else than SR.pi()
, you can redefine pi = RR.pi()
if you want to type things more easily.