Re: [R] as.complex()
What is your actual problem that you are trying to solve by comparing imaginary numbers? The reals are an ordered field. The complex numbers are a field but cannot support an ordering that is consistent with the field (or even ring) axioms. The imaginary numbers are not a field or even a ring. To quote Brian Marick's wonderful sticker, "An example would be good about now". On Tue, 26 Mar 2024 at 03:17, Thomas K wrote: > > Needing a < , > comparison for imaginary numbers > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] as.complex()
That's hard to define unambiguously at a mathematical level. What definition did you have in mind? Can you provide more context? (Maybe you want to compare Mod(x) to Mod(y) ?) On 2024-03-25 3:23 a.m., Thomas K wrote: Needing a < , > comparison for imaginary numbers __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] as.complex()
?complex On March 25, 2024 12:23:43 AM PDT, Thomas K wrote: >Needing a < , > comparison for imaginary numbers > >__ >R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code. -- Sent from my phone. Please excuse my brevity. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] as.complex()
Hi Thomas, If you want to compare the imaginary portions, you could do: Im(z1) < Im(z2) If you want to compare the magnitudes, you could do: Mod(z1) < Mod(z2) If you want to compare complex numbers, i.e. z1 < z2, well that just doesn't make sense. On Mon, Mar 25, 2024, 10:17 Thomas K wrote: > Needing a < , > comparison for imaginary numbers > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] as.complex()
Needing a < , > comparison for imaginary numbers __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.