View mode: basic / threaded / horizontal-split · Log in · Help
March 10, 2003
Re: abs property for creal?
John Reimer wrote:
> Did someone confuse vectors with complex numbers?  I didn't notice... In
> another response, I think we were just talking about the similarities.
Well, aehem, ..., I sometimes have the feeling that Sean Palmer only
thinks of them as a clever way to make 2D vector manipulations. Nothing 
personal though, Sean. I just don't agree, that complex numbers should
only be included into the core language iff vectors are included as well.
One reason, that many "numeric" people stuck with Fortran instead of C
was the lack of complex numbers in C. (The other reason of course is 
the HUGE amount of quality numeric libraries for Fortran).

Olaf

-- 
+----------------------------------------------------------------------+
I Dr. Olaf Rogalsky                         Institut f. Theo. Physik I I
I Tel.: 09131 8528440                       Univ. Erlangen-Nuernberg   I
I Fax.: 09131 8528444                       Staudtstrasse 7 B3         I
I rogalsky@theorie1.physik.uni-erlangen.de  D-91058 Erlangen           I
+----------------------------------------------------------------------+
March 10, 2003
Re: abs property for creal?
"Olaf Rogalsky" <olaf.rogalsky@theorie1.physik.uni-erlangen.de> wrote in
message news:3E6CD6EC.B3845F79@theorie1.physik.uni-erlangen.de...
> John Reimer wrote:
> > Did someone confuse vectors with complex numbers?  I didn't notice... In
> > another response, I think we were just talking about the similarities.
> Well, aehem, ..., I sometimes have the feeling that Sean Palmer only
> thinks of them as a clever way to make 2D vector manipulations. Nothing
> personal though, Sean. I just don't agree, that complex numbers should
> only be included into the core language iff vectors are included as well.
> One reason, that many "numeric" people stuck with Fortran instead of C
> was the lack of complex numbers in C. (The other reason of course is
> the HUGE amount of quality numeric libraries for Fortran).

Oh yes, now I see.  True, true.  I was so caught up in arguing my points in
previous posts that I didn't really think of how the vector topics were
being introduced.  The distinction is significant in this regard.

That is an interesting note about Fortran and very true.  Complex math has
been around in the computer field for quite awhile and has many uses, so
it's inclusion as a D type seems to be the first logical addition.
Quaternions and 3D vectors are much more specialized in there application in
comparison, are they not?  So I can see why they are not being so quickly
adopted as a intrinsic type here.

But with the huge explosion in computer graphics technology and development,
I can see why people are looking to see their (vectors) use as more of a
staple in computer languages.  Maybe someday someone will decide that that
vectors are now deemed worthy of inclusion, just as there was a point in the
past where complex numbers proved critical for inclusion in some languages.
I don't know if we've reached that point yet, though, with D.

I really see no problem with keeping complex in and vectors out.  That does
not compromise consistancy, since as you say complex numbers are just
numbers with a few interesting properties. They fit the spot quite well.

Later,

John
April 14, 2003
Re: abs property for creal?
"John Reimer" <jjreimer@telus.net> wrote in message
news:b4bnbb$2oe8$1@digitaldaemon.com...
> The short program listing is available if anyone is interested to see why
> the compiler crashed...

I'm interested. Please post or email it to me. Thanks, -Walter
April 14, 2003
Re: abs property for creal?
"Burton Radons" <loth@users.sourceforge.net> wrote in message
news:b4eavm$11s2$1@digitaldaemon.com...
> John Reimer wrote:
> >>It's syntactually correct, but better is:
> >>
> >>    real abs(creal c) {
> >>       return math2.hypot(c.re, c.im);
> >>    }
> >>
> >>As sqrt uses double, and hypot can do some overflow/underflow
> >
> > minimisation.
> >
> > That does look good :-).  But I've never seen a math2 module before.  Is
it
> > now part of phobos?
>
> Yeah, it's a large set of routines that Pavel Minayev wrote.  It should
> probably be merged with math.  For your later concern, this is how
> Python implements complex abs.

It's now in math.hypot. Also, math.hypot handles all the overflow/underflow
cases correctly.
April 17, 2003
Re: abs property for creal?
Walter wrote:
> "John Reimer" <jjreimer@telus.net> wrote in message
> news:b4bnbb$2oe8$1@digitaldaemon.com...
> 
>>The short program listing is available if anyone is interested to see why
>>the compiler crashed...
> 
> 
> I'm interested. Please post or email it to me. Thanks, -Walter
> 
> 

Hi Walter,

Um, I should say was available...

A major computer malfunction several weeks ago has left me without the 
source, though I should be able to cook up the problem again for you.

I'll see if I can get some source up in the next few days...

Thanks,

John
April 17, 2003
Re: abs property for creal?
Walter wrote:

> "Burton Radons" <loth@users.sourceforge.net> wrote in message
> news:b4eavm$11s2$1@digitaldaemon.com...
> 
>>John Reimer wrote:
>>
>>>>It's syntactually correct, but better is:
>>>>
>>>>   real abs(creal c) {
>>>>      return math2.hypot(c.re, c.im);
>>>>   }
>>>>
>>>>As sqrt uses double, and hypot can do some overflow/underflow
>>>
>>>minimisation.
>>>
>>>That does look good :-).  But I've never seen a math2 module before.  Is
> 
> it
> 
>>>now part of phobos?
>>
>>Yeah, it's a large set of routines that Pavel Minayev wrote.  It should
>>probably be merged with math.  For your later concern, this is how
>>Python implements complex abs.
> 
> 
> It's now in math.hypot. Also, math.hypot handles all the overflow/underflow
> cases correctly.
> 
> 

Great!

I almost missed these posts.  I didn't realize you would respond to 
stuff so far back ;-).

Thanks,

John
April 18, 2003
Re: abs property for creal?
John Reimer wrote:

> Walter wrote:
> 
>> "John Reimer" <jjreimer@telus.net> wrote in message
>> news:b4bnbb$2oe8$1@digitaldaemon.com...
>>
>>> The short program listing is available if anyone is interested to see 
>>> why
>>> the compiler crashed...
>>
>>
>>
>> I'm interested. Please post or email it to me. Thanks, -Walter
>>
>>
> 
> Hi Walter,
> 
> Um, I should say was available...
> 
> A major computer malfunction several weeks ago has left me without the 
> source, though I should be able to cook up the problem again for you.
> 
> I'll see if I can get some source up in the next few days...
> 
> Thanks,
> 
> John
> 
> 

Ok,

Rebuilt and sent.
I used D compiler 0.61.

Hope that helps.

John
April 18, 2003
Re: abs property for creal?
Got it. Thanks!
April 18, 2003
Re: abs property for creal?
"John Reimer" <jjreimer@telus.net> wrote in message
news:b7n8ij$19lt$2@digitaldaemon.com...
> I almost missed these posts.  I didn't realize you would respond to
> stuff so far back ;-).

I'm waay behind <g>.
Next ›   Last »
1 2 3
Top | Discussion index | About this forum | D home