Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Does Micro C compiler support floating point?Does Micro C include “math.h” and related functions?

0
Posted

Does Micro C compiler support floating point?Does Micro C include “math.h” and related functions?

0

No, Micro C is an integer only (non floating point) implementation of C. This means that it does not support the “float” and “double” types, and does not include “sin(), cos(), tan(), log() etc.” functions. The decision not to support floating point was made partly because it simplifies type conversions and reduces the size of the runtime library, but mainly because floating point is inefficient and usually unnecessary in most embedded systems. All of the development kits do include a long integer library, which can perform fast integer arithmetic on numbers of up to 256 bytes (2048 bits) in length. Many/most projects for which the programmer wishes to use floating point can often be more efficiently implemented with scaled large integers. The 8051 compiler does include a floating point library, which was made available by one of the customers.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123