February 12, 2003 Re: complex, imaginary, and extended | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ben Hinkle | "Ben Hinkle" <bhinkle@mathworks.com> wrote in message news:b0kq0v$blh$1@digitaldaemon.com... > > > ifloat = imaginary float > > idouble = imaginary double > > ireal = imaginary real > > I wonder about these. How often does one work with in the pure imaginary numbers for more than a single operation or two? I would get by just fine with just the other 6 (pure real and complex of different precisions). Does > any other language have pure imaginary types? I don't know off-hand. Imaginary numbers as a distinct type are necessary if you're going to do complex arithmetic without weird errors. See Prof. Kahan's paper on it. http://www.cs.berkeley.edu/~wkahan/Curmudge.pdf (Thanks to Mark Evans for digging up the url.) |
February 13, 2003 Re: complex, imaginary, and extended | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | The thing about imaginary numbers is that if you multiply two imaginary numbers together, the sign is the opposite what you'd get if they were real numbers (correct me if I'm wrong). Sean ----- Original Message ----- From: "Walter" <walter@digitalmars.com> Newsgroups: D Sent: Wednesday, February 12, 2003 1:23 AM Subject: Re: complex, imaginary, and extended > > "Ben Hinkle" <bhinkle@mathworks.com> wrote in message news:b0kq0v$blh$1@digitaldaemon.com... > > > > > ifloat = imaginary float > > > idouble = imaginary double > > > ireal = imaginary real > > > > I wonder about these. How often does one work with in the pure imaginary numbers for more than a single operation or two? I would get by just fine > > with just the other 6 (pure real and complex of different precisions). > Does > > any other language have pure imaginary types? I don't know off-hand. > > Imaginary numbers as a distinct type are necessary if you're going to do complex arithmetic without weird errors. See Prof. Kahan's paper on it. > > http://www.cs.berkeley.edu/~wkahan/Curmudge.pdf > > (Thanks to Mark Evans for digging up the url.) |
February 14, 2003 Re: complex, imaginary, and extended | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Digging around it seems like pure imaginary types are useful for distinguishing -0i from +0i, but I don't see why you can't have values 0+(-0)i and 0+(+0)i and the complex arithmetic works out to exactly the same thing as the purely-imaginary arithmetic. Kahan's complaint about Fortran complex types is (I think) that it ignores -0 and +0 quantities (either in the real or imaginary part). I haven't read the rationale behind adding it to C99, though, so there could be problems with trying to put -0 and +0 into complex arithmetic. If it's really impossible then adding pure imaginary types makes sense. -Ben "Walter" <walter@digitalmars.com> wrote in message news:b2d40k$2jjn$1@digitaldaemon.com... > > "Ben Hinkle" <bhinkle@mathworks.com> wrote in message news:b0kq0v$blh$1@digitaldaemon.com... > > > > > ifloat = imaginary float > > > idouble = imaginary double > > > ireal = imaginary real > > > > I wonder about these. How often does one work with in the pure imaginary numbers for more than a single operation or two? I would get by just fine > > with just the other 6 (pure real and complex of different precisions). > Does > > any other language have pure imaginary types? I don't know off-hand. > > Imaginary numbers as a distinct type are necessary if you're going to do complex arithmetic without weird errors. See Prof. Kahan's paper on it. > > http://www.cs.berkeley.edu/~wkahan/Curmudge.pdf > > (Thanks to Mark Evans for digging up the url.) > > |
Copyright © 1999-2021 by the D Language Foundation