[net.micro.6809] BASIC09 floating point faster than C

emjej@uokvax.UUCP (11/29/84)

/***** uokvax:net.micro.6809 / ihnss!knudsen /  9:18 pm  Nov 26, 1984 */
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).

	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
/* ---------- */

Actually, internally BASIC09 floats are five-byte quantities, like Microshaft
BASIC for the CoCo. (One byte exponent, four-byte mantissa, the moral near-
equivalent of ~9-10 significant decimal digits.)

However, I heartily agree with you: the Microware C floating-point stuff is
REAL SLOW. This is the only point at which a 2MHz 6809 won't keep ahead of
an IBM PC and only slightly behind slower compilers for 10 MHz 8086 systems.
It's a shame--they really ought to borrow floating-point routines from
BASIC09 (both arithmetic and math library: the BASIC09 docs say that they
use CORDIC methods, by the way, for those who have been following the stuff
in net.lang.c about sin & cos).

BTW, a fellow (name lamentably forgotten, or I'd give credit where due)
posted a math library he wrote to the OS-9 SIG on CompuServe; it should
be available for the downloading.

						James Jones

mwm@ea.UUCP (12/01/84)

/***** ea:net.micro.6809 / uokvax!emjej /  1:05 pm  Nov 29, 1984 */
/***** uokvax:net.micro.6809 / ihnss!knudsen /  9:18 pm  Nov 26, 1984 */
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).
/* ---------- */
However, I heartily agree with you: the Microware C floating-point stuff is
REAL SLOW.
					James Jones
/* ---------- */

Let me ask a couple of question: does the Microware C support double (AKA
"long float") variables? If so, do they follow K & R, and *automatically*
convert all float to double?

If you want more reasons not to do floating point in C, just ask.

	<mike

emjej@uokvax.UUCP (12/08/84)

[observing the nesting habits of brackets]

/* from ea!mwm... *?
Let me ask a couple of questions: does the Microware C support double (AKA
"long float") variables? If so, do they follow K & R, and *automatically*
convert all float to double?
/* ---------- */

Yup, and yup. They do indeed follow the moosehead conventions of K&R C in
this respect. Float is four bytes, double eight.

					James Jones