Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!seismo!rochester!pt.cs.cmu.edu!ius2.cs.cmu.edu!edw From: edw@ius2.cs.cmu.edu.UUCP Newsgroups: comp.lang.c Subject: Re: C and Floating Point (really parentheses) Message-ID: <1094@ius2.cs.cmu.edu> Date: Wed, 8-Apr-87 22:00:41 EST Article-I.D.: ius2.1094 Posted: Wed Apr 8 22:00:41 1987 Date-Received: Sat, 18-Apr-87 02:31:53 EST References: Organization: Carnegie-Mellon University, CS/RI Lines: 45 In article , bader#@andrew.cmu.edu (Miles Bader) writes: > evaluation. That way, order-of-evaluation weenies (:-) will have > their way and their code won't look like C (since they obviously want > to be programming in fortran), and no-one else will know the > difference (and existing code will still run as fast). > community which is a small fraction of the whole. This is C, people, > like it or not. If you want another language, use another language. > > -Miles Agree totally!! #define X 0 #define Y 1 #define _EPSILON .0002 #define sqr(x) (x*x) #define distance(x1,x2,y1,y2) (sqrt((double (sqr(x1-x2) + sqr(y1-y2))))) #define approx_equal(x,y) (fabs(double (x - y)) < _EPSILON) #define same_point(x1,x2,y1,y2) (approx_equal(distance(x1,x2,y1,y2),0)) . . . if (same_point(p1[X],0.0,p1[Y],0.0)) .... I trust that my C compiler is going to optimize the hell out of this expression. Is this a good enough reason to allow reordering? -- Eddie Wyatt They say there are strangers, who threaten us In our immigrants and infidels They say there is strangeness, too dangerous In our theatres and bookstore shelves Those who know what's best for us- Must rise and save us from ourselves Quick to judge ... Quick to anger ... Slow to understand... Ignorance and prejudice and fear [all] Walk hand in hand. - RUSH