Main Content
Invalid scientific notation format
Description
This issue occurs when you express a floating-point literal in exponential form but you do not use the standard scientific notation format of one nonzero digit before the decimal.
Polyspace® does not flag the use of zero before the decimal to represent literal
0.0
in exponential form, for instance 0.00E+0
.
Risk
The use of non-standard scientific notations to represent literals makes your code less readable and more error-prone.
Fix
Use the standard format of one nonzero digit before the decimal to express floating-point literals in scientific notation.
Examples
Result Information
Group: Good Practice |
Language: C | C++ |
Default: Off |
Command-Line Syntax:
INVALID_NOTATION_ON_E_CONSTANT |
Impact: Low |
Version History
Introduced in R2022b