This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM46L852: Possible Dangers Using Floating Point Operations

Part Number: RM46L852


Hello,

for a functional safety project we are currently trying to determine/evaluate the possible dangers caused by the usages of floats (and float operations/calculations). As far as we can tell, there are many ways to archive for example undefined behaviors when it comes to floats.

For example:

  • division by zero,
  • overflow,
  • underflow,
  • trap representations read by an lvalue (from C18 Standard, Annex J.2),
  • demotion of one real float to another producing a value outside of the range that can be represented (from C18 Standard, Annex J.2)
  • an argument to a floating-point classification or comparison macro is not real floating type (from C18 Standard, Annex J.2)
  • etc.

 

So, we were wondering: What is the worst that can happen when using floats or float operations/calculations?

  • Can a memory corruption happen (read-only memory and/or RAM)?
  • Can the program code or/and program flow be manipulated?
  • Or what other dangerous influences can the usage of floats have?

 

Kind regards

Sebastian Ahrens