Path: csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: sfeam Newsgroups: comp.graphics.apps.gnuplot Subject: Re: (negative Value)**(-1.0) creates complex values Followup-To: comp.graphics.apps.gnuplot Date: Sat, 26 May 2012 10:38:42 -0700 Organization: gnuplot development team Lines: 23 Message-ID: References: <05e72b70-4601-4c79-9102-b6ee4ad1b6f9@k5g2000vbf.googlegroups.com> Reply-To: sfeam@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit Injection-Date: Sat, 26 May 2012 17:38:44 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="3mhAfh4CeAIeL3OKnPexDA"; logging-data="4829"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/5Om2rOlyeo3SO+uiSB+Gi" User-Agent: KNode/4.4.9 Cancel-Lock: sha1:ig6cgTzkBLm9ovvoEzKelYzV8u4= Xref: csiph.com comp.graphics.apps.gnuplot:1148 Ingo Thies wrote: > Am 2012-05-25 20:45, schrieb Hans-Bernhard Bröker: > >>> Is there a way to prevent gnuplot from generating complex numbers >>> for (negative Value)**(-1.0) and similar cases. >> >> No. Nor should there be one. > > Well, (-1)**(-1) is just 1/(-1) = -1. The tiny imaginary part is just > a rounding error. But I can't see a smooth way to avoid them since > gnuplot doesn't know whether a real exponent is ever indented to > become a non-integer value. It seems to me that the complaint is really about the output format. The OP would like a way to print {-1.0, -1.22460635382238e-016} as -1, similar to the way %f would print -1.22460635382238e-016 as -0.000000. That is, they want a format specifier that hides the complex nature of a number whose imaginary component is sufficiently small. But neither C nor gnuplot offers special format specifiers for complex numbers. Ethan