Browse Publications Technical Papers 2017-01-1619
2017-03-28

Safe Handling of Floating Point Math in C Code Embedded Applications 2017-01-1619

The introduction of floating point math in Embedded Application ECU’s has made the implementation of complex math functions less error prone but not error proof. This paper shall focus on raising awareness of the pitfalls that come from the use of the basic floating point arithmetic operations, that is, Divide, Multiply, Add and Subtract. Due to the known pitfalls inherent in these basic math operations, it is proposed that a standard library with common functions appropriate for Powertrain Embedded applications (but not limited to Powertrain) be identified. This paper shall explore what these common functions will look like for both standard C code as well as the equivalent versions in Matlab™ Simulink™. The particular pitfalls this paper shall discuss are Divide-By-Zero, Overflow, Underflow and Loss-Of-Precision for both single and double precision floating point variables. This paper shall reference the IEEE-754 Floating Point standard used by most Embedded C applications. This paper shall discuss the importance of recognizing these pitfalls as well as understanding the trade-offs in terms of processor resources.

SAE MOBILUS

Subscribers can view annotate, and download all of SAE's content. Learn More »

Access SAE MOBILUS »

Members save up to 16% off list price.
Login to see discount.
Special Offer: Download multiple Technical Papers each year? TechSelect is a cost-effective subscription option to select and download 12-100 full-text Technical Papers per year. Find more information here.
We also recommend:
TECHNICAL PAPER

Model-Based Design Methods for the Development of Transmission Control Systems

2014-01-0304

View Details

JOURNAL ARTICLE

Automated Verification and Validation Methods for Transmission Control Software

2015-01-0163

View Details

TECHNICAL PAPER

How to Keep Consistency between System Architecture and Their Fault Trees: A Lightweight Approach

2018-01-1073

View Details

X