Doubles?

Discussion of issues related specifically to writing code for native mode devices. This includes ZBasic code as well as assembly language code and C code, both inline and standalone.
Post Reply
GTBecker
Posts: 616
Joined: 17 January 2006, 19:59 PM
Location: Cape Coral

Doubles?

Post by GTBecker »

A question just posed on the Yahoo Basic-X group asks if 64-bit math can be done; the answer there will be no - but it's a good question to ask here.

Might a complete set of 64-bit math functions be done in native mode?
Tom
mikep
Posts: 796
Joined: 24 September 2005, 15:54 PM

Post by mikep »

This is an item I have asked Don about before; more to round out the language than anything else. I think that the main reason that only single precision arithmetic is supported is because there really aren't that many requirements to use double precision arithmetic (DP) on a 8-bit micro. If you really want DP then you probably also want a much faster machine like a 32-bit ARM microprocessor. After all, you are now doing some serious number crunching.

Certainly with native support you can mix C code that does DP arithmetic with ZBasic code in the same application. You would need to also handle the conversions in and out of DP from other data types as well.
Mike Perks
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: Doubles?

Post by dkinzer »

GTBecker wrote:Might a complete set of 64-bit math functions be done in native mode?
It is certainly feasible. There has been some discussion on the AVR Freaks forum about this. I suspect that double precision will eventually be added to the avr-gcc compiler.
- Don Kinzer
Post Reply