L
Lane Straatman
You're plain funny. LSEric Sosman said:That's plane wrong.
You're plain funny. LSEric Sosman said:That's plane wrong.
Malcolm McLean said:If we multiply an imaginary number by itself an imaginary number of times,
maybe that would be real, on the analogy that a negative number multiplied
by itself is a positive.
Let's try it
int main(void)
{
int unity = 1;
int test1;
test1 = 0 - unity;
printf("%d * %d = %d\n", test1, test1, test1 * test1);
printf("Now a bit more complex %f\n", pow( sqrt(test1), sqrt(test1) );
return 0;
}
Nope.
Richard Heathfield said:Eric Sosman said:
Either you have a couple of axes to grind, or you're misreading what
Malcolm wrote, which rings true.
Lane Straatman said:For kicks and giggles, I'd like to see how precise one can get with this
using these predefined types. arctan of 1.0 will improve pi. Is there an
easy way to adduce e in C to the full width of a double? LS
Microsoft have taken away my compiler. I bought a brand new Windows VistaKeith Thompson said:Let me guess, you were so certain you were right that you didn't
bother to try it.
Microsoft have taken away my compiler. I bought a brand new Windows Vista
machine, installed my copy of Visual Studio and - no executable.
A lot of them are, but this is exactly the type that would not be: filledjacob navia said:Lane Straatman a écrit :[...]
If we multiply an imaginary number by itself an imaginary number of
times, maybe that would be real, on the analogy that a negative number
multiplied by itself is a positive.
Let's try it
[commented out, below]
Nope.
I'm not sure what Malcolm is trying to do here. Without the overloading
of functions in tgmath.h, I doubt that sqrt() and pow() are going to
cover the complex cases. I couldn't get sqrt() to work on an imaginary.
Devcpp doesn't even have tgmath.h . I copied it out of lcc and put it in
the include file and got a cool 300 errors:
That will never work.
Sorry, header files are NOT portable
Seriously?Richard Heathfield said:You need Service Pack 7. Admittedly, Visual Studio won't work with that
either (possibly modulo emulators), but you get a perfectly capable C
compiler as part of the bundle. And of course it's completely free.
Lane Straatman said:Is there something about tgmath.h that makes its inclusion here ill-advised?
Seriously?
I need a Windows library to compile my games and BASICdraw,
Malcolm McLean said:
You need Service Pack 7. Admittedly, Visual Studio won't work with that
either (possibly modulo emulators), but you get a perfectly capable C
compiler as part of the bundle. And of course it's completely free.
I hope he takes from this a means to further his adducation.Keith Thompson said:Yes, what Malcolm wrote about "what most folks think" is at least
plausible (though I suspect that most people who would ask what
e^(i*pi) is in the first place are likely to know the answer). It
wasn't entirely clear to me that Malcolm understands the issue
himself.
He's got me after complex roots, now, and I've thought about it enough toOn the other hand, perhaps Malcolm's subtlety just escaped me, in
which case I'm duly embarrassed to have missed it.
Axis is correct, as one of them is Joshu's. LSThe fact that I wrote the above *before* I got the "couple of axes"
joke makes this more likely. *Sigh*
Lane said:.... snip ...
#include <stdio.h>
#include <stdbool.h>
#include <complex.h>
int main(void)
{
double complex z3, z4, z5;
z5= 0 + I*(3.14159);
z3=2.71828 + 0*I;
z4=cpow(z3,z5);
printf("%lf %lf\n", creal(z4), cimag(z4));
return 0;
}
Thanks for replies. e is now set closer to what Dr. Kelly has
listed for it, and I've got the right order on cpow().
For kicks and giggles, I'd like to see how precise one can get
with this using these predefined types. arctan of 1.0 will
improve pi. Is there an easy way to adduce e in C to the full
width of a double? LS
In C, the atan() functions are a bunch of rationals. Ideally, inrationals in C, we have a bunch of transcendentals as the arctan's of these
numbers. LS
I don't want you to think that I would tea up on you for your lack ofRichard Heathfield said:Malcolm McLean said:
Er, no. Sorry, Malcolm, I thought you knew - "Service Pack 7" is the
traditional
name for Linux when being recommended as a fix for a Windows-specific
problem.
You have just discovered that Microsoft aren't all that interested in
supporting
"legacy software" (e.g. their own two-year-old compiler, if your account
is
anything to go by). Have you considered porting your stuff to a more
stable
platform?
You couldn't be more wrong. I had a conversation with C_Dreamer about this.Tim Prince said:Lane Straatman wrote:
Since we have a bunch of
In C, the atan() functions are a bunch of rationals. Ideally, in certain
ranges, with something resembling IEEE754 compliance, the quality is
measurable in ULPS difference between the actual result and the
mathematically correct one. It looks like you jumped from C to something
else in mid-sentence.
Lane Straatman said:Devcpp doesn't even have tgmath.h .
I copied it out of lcc
Is there something about tgmath.h that makes its inclusion here ill-advised?
Malcolm McLean said:Microsoft have taken away my compiler. I bought a brand new Windows Vista
machine,
You couldn't be more wrong.
Lane said:For kicks and giggles, I'd like to see how precise one can get with
this using these predefined types.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.