Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Quadratic number fields

Hello!

I try to implement an inclusion test, of which I thought it must be quite simple, but until now I cannot figure out how to do it properly. Problem: Given any element x, test if x is included in some quadratic number field and return true/false. I tried the following:

x = 2 + sqrt(5) K = QuadraticField(5) print(x in K)

Here, the answer is 'no' or 'false' which is obviously wrong, so I assume I'm doing something completely wrong. What do I have to change?

Quadratic number fields

Hello!

I try to implement an inclusion test, of which I thought it must be quite simple, but until now I cannot figure out how to do it properly. Problem: Given any element x, test if x is included in some quadratic number field and return true/false. I tried the following:

x = 2 + sqrt(5)
K = QuadraticField(5)
print(x in K)

K)

Here, the answer is 'no' or 'false' which is obviously wrong, so I assume I'm doing something completely wrong. What do I have to change?

click to hide/show revision 3
retagged

Quadratic number fields

Hello!

I try to implement an inclusion test, of which I thought it must be quite simple, but until now I cannot figure out how to do it properly. Problem: Given any element x, test if x is included in some quadratic number field and return true/false. I tried the following:

x = 2 + sqrt(5)
K = QuadraticField(5)
print(x in K)

Here, the answer is 'no' or 'false' which is obviously wrong, so I assume I'm doing something completely wrong. What do I have to change?

click to hide/show revision 4
retagged

Quadratic number fields

Hello!

I try to implement an inclusion test, of which I thought it must be quite simple, but until now I cannot figure out how to do it properly. Problem: Given any element x, test if x is included in some quadratic number field and return true/false. I tried the following:

x = 2 + sqrt(5)
K = QuadraticField(5)
print(x in K)

Here, the answer is 'no' or 'false' which is obviously wrong, so I assume I'm doing something completely wrong. What do I have to change?

Quadratic number fields

Hello!

I try to implement an inclusion test, of which I thought it must be quite simple, but until now I cannot figure out how to do it properly. Problem: Given any element x, test if x is included in some quadratic number field and return true/false. I tried the following:

x = 2 + sqrt(5)
K = QuadraticField(5)
print(x in K)

Here, the answer is 'no' or 'false' which is obviously wrong, so I assume I'm doing something completely wrong. What do I have to change?

click to hide/show revision 6
retagged

Quadratic number fields

Hello!

I try to implement an inclusion test, of which I thought it must be quite simple, but until now I cannot figure out how to do it properly. Problem: Given any element x, test if x is included in some quadratic number field and return true/false. I tried the following:

x = 2 + sqrt(5)
K = QuadraticField(5)
print(x in K)

Here, the answer is 'no' or 'false' which is obviously wrong, so I assume I'm doing something completely wrong. What do I have to change?