Path: utzoo!attcan!uunet!snorkelwacker.mit.edu!hsdndev!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.lang.misc Subject: Re: Fortran vs. C for numerical work - expression notation Message-ID: <1893:Dec1200:57:4190@kramden.acf.nyu.edu> Date: 12 Dec 90 00:57:41 GMT References: <8339@lanl.gov> <914:Dec923:50:2990@kramden.acf.nyu.edu> <2309@enea.se> Organization: IR Lines: 37 In article <2309@enea.se> sommar@enea.se (Erland Sommarskog) writes: > Also sprach Dan Bernstein (brnstnd@kramden.acf.nyu.edu): > >I sure hope not. The computer treats complex types quite differently > >from integer types, and I want to be reminded of that difference when > >I'm programming. Until a computer can *do* mathematics I don't want to > >pretend that it can *talk* mathematics. > The computer treats integers and reals different too, don't > you want to be reminded by that each time you write a program? Yes. This is one of the advantages of Forth. Integer addition is just like normal addition except for overflow. I'm willing to accept a normal plus sign for it. Floating-point addition is vastly different. The only reasonably standard notation I've seen for it is Knuth's plus-in-a-circle, but this conflicts with other uses of circles. I'd be happier with fadd(x,y) than with x + y. > And the day you discover you have to go from reals to complex, > do you just love having to write the code, just because the > language - either by built-ins or overloading - does not allow > you use infix notation for complex numbers? Huh? It's not my problem if you have an incompetent editor. I use my editor to reduce my typing time. I use my programming language to express instructions to a computer. I use my pretty-printer to make my programs more readable on paper. Each stage has a different view of floating-point addition, and that's how it should be. > Or maybe, software > maintenance is something you never have to bother about? How does it hurt maintenance to use realistic notations? ---Dan