[comp.lang.c] Complex type / C++

molbio@monet.Berkeley.EDU (Mr. Molbio) (05/11/87)

Summary:

References:

Disorganization: U.C. Berkeley


>data type.  There is a problem, though, with trying to borrow the
>real-number arithmetic operations for use with other types of
>"number".  For example, I am at a loss as to what U*V should mean
>for U,V vectors.  Is that an outer product? wedge product? inner
>product? what metric?  (Certainly the componentwise product of the
>holors is not what is wanted.)  Multiplication of fancy numbers (e.g.
>matrices) tends not to be commutative.  What symbol do we use for the
>very important transposition operator?  How about inverses (division
>is often not a useful concept for fancy numbers)..

Good point.  It makes sense not to try and overload "*",
which is always commutative in C (and may be rearranged by the
compiler) with a non-commutative operator.

How do languages like C++ and Ada deal with this?
Do they require the definition of some minimal set of operators?

Is there a K&R of C++?  I would like to learn more about C++
but don't know how to go about doing this.

        ..!ucbvax!xcssun!thomas

guy@gorodish.UUCP (05/11/87)

> How do languages like C++ and Ada deal with this?
> Do they require the definition of some minimal set of operators?

C++ permits you to overload any of the existing operators.  The new
operators have the same arity and precedence as the one that's being
overloaded.  (In other words, you can't change the syntax of the
language.)

> Is there a K&R of C++?

Yup.  It's called "The C++ Programming Language", is published by
Addison-Wesley (as was K&R), and is in somewhat the same format as
K&R (a pile of tutorial information with the Reference Manual stuck
in the back).  It's by Bjarne Stroustrup (no surprise there), and is
ISBN 0-201-12078-X

dc@sdd.UUCP (Daniel Corbett) (05/13/87)

	The K&R of C++ is C++ by Bjarne Stroustrup

	The publisher is Addison-Wesley.

	You should be able to find  the book in any technical book
	store which has a good selection of software books.  I got
	mine at the UCLA student book store...

								-dc