MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Algebraic Integers


Thanks to all who replied. 

Considering that P can be more complex that I mentioned 
(for example 23-sqrt(17)), the solution should not use
N[] in the first place. Here is what I came up with:

P /: N[P, n_:6] := N[23 - Sqrt[17], n];

Unprotect[Less];
	Less[a_. + b_. P, c_. + d_. P] := 
			LessZero[(a - c) + P (b - d)];
	Less[a_, b_. + c_. P] := LessZero[(a - b) - c P];
	Less[a_. + b_. P, c_] := LessZero[(a - c) + b P];
Protect[Less];

(* This can be simply N[] or something less trivial *)
LessZero[x_] := N[x, 200] < 0 

Unprotect[Min, Max];
	Min[x_List] := First[Sort[x, Less]];
	Max[x_List] := Last[Sort[x, Less]];
Protect[Min, Max];


Konstantin.


  • Prev by Date: Help on solving simultaneous non-linear equations using FindRoot.
  • Next by Date: Re: ListPlot with row vectors
  • Previous by thread: Re: Algebraic Integers
  • Next by thread: Re: Algebraic Integers