# HG changeset patch
# User Jenny Cooley <j.a.cooley@warwick.ac.uk>
# Date 1374662667 3600
# Node ID cc944241f5eb06d323f29eeb4c0643d9fadc5cff
# Parent 0f8fd922eaed351e39f913f1317d319dcceb4c01
Trac 12270 swaps the order of the two independent processes described on the trac.
diff git a/sage/rings/number_field/number_field.py b/sage/rings/number_field/number_field.py
a

b


5680  5680  # Convert from L to K 
5681  5681  K = self 
5682  5682  L = x.parent() 
5683   # List of candidates for K(x) 
5684   f = x.minpoly() 
5685   ys = f.roots(ring=K, multiplicities=False) 
5686   if not ys: 
5687   raise ValueError, "Cannot convert %s to %s (regardless of embeddings)"%(x,K) 
5688   
5689  5683  # Find embeddings for K and L. If no embedding is given, simply 
5690  5684  # take the identity map as "embedding". This handles the case 
5691  5685  # where one field is created as subfield of the other. 
… 
… 

5720  5714  else: 
5721  5715  raise TypeError, "No compatible natural embeddings found for %s and %s"%(KF,LF) 
5722  5716  
 5717  # List of candidates for K(x) 
 5718  f = x.minpoly() 
 5719  ys = f.roots(ring=K, multiplicities=False) 
 5720  if not ys: 
 5721  raise ValueError, "Cannot convert %s to %s (regardless of embeddings)"%(x,K) 
 5722  
5723  5723  # Define a function are_roots_equal to determine whether two 
5724  5724  # roots of f are equal. A simple a == b does not suffice for 
5725  5725  # inexact fields because of floatingpoint errors. 