Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Edited by sciSpider v2.4 (sch jbop) (X_X)@==(Q_Q)@

...

This rule does not apply to demotions of floating point types on implementations that support signed infinity, such as IEEE 754, as all numbers are representable.

...

Noncompliant Code Example (int-float)

The following non-compliant noncompliant code leads to undefined behavior if the integral part of f1 cannot be represented as an integer.

...

Code Block
bgColor#ccccff
float f1;
int i1;

/* initializations */

if (f1 > (float) INT_MAX || f1 < (float) INT_MIN) {
  /* Handle Error */
} else {
  i1 = f1;
}

...

Noncompliant Code Example (demotions)

The following non-compliant noncompliant code shows casts of values that may not be outside of the range of the demoted type.

...