knudsen@ihnss.UUCP (11/27/84)
<is this bit necessary?> 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