Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 exptools 1/6/84; site ihnss.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!ihnss!knudsen From: knudsen@ihnss.UUCP Newsgroups: net.micro.6809 Subject: BASIC09 floating point faster than C's!?! Message-ID: <2314@ihnss.UUCP> Date: Mon, 26-Nov-84 18:30:20 EST Article-I.D.: ihnss.2314 Posted: Mon Nov 26 18:30:20 1984 Date-Received: Tue, 27-Nov-84 04:38:39 EST Organization: AT&T Bell Labs, Naperville, IL Lines: 19 This is so crazy that I'm almost afraid to post it. It appears that the same program runs faster in Basic09 than in Microware C (both on a Coco). In fact, the C version runs about even with ROM Basic, Extended. The program is a simple simulation of a planet in orbit around a sun, which I first wrote over a year ago in Basic. It uses some floating point mults and divides, and ONE call to square root. Since Microware C has no math library, I wrote a Newton's-method square root routine which is pretty standard, I'd say. Results: Even if the program just prints out the X,Y coordinates of the planet as it goes around its orbit, the Basic09 version runs anywhere from 5 to 10 times faster than either C or RadioShack Basic. I can understand Basic being slow, and it uses 40-bit floats. However, C and Basic09 both use 32-bit floats (I declared everything float, not double in C), and I'd expect C to be at least as fast as Basic09. What UNIVAC I (c. 1950) did Microware steal their floating point operators from for C? SHould they take the guys across the hall in the Basic09 dept. out for a few beers and borrow their floating +-*/ ? mike k