Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ccccff
langc
#include <float.h>
 
void func(double d_a, long double big_d) {
  double d_b;
  float f_a;
  float f_b;

  if (isgreater(d_a, FLT_MAX) || isless(d_a, FLT_MAXMIN)) {
    /* Handle error */
  } else {
    f_a = (float)d_a;
  }
  if (isgreater(big_d, FLT_MAX) || isless(big_d, FLT_MAXMIN)) {
    /* Handle error */
  } else {
    f_b = (float)big_d;
  }
  if (isgreater (big_d, DBL_MAX) || isless(big_d, DBL_MAXMIN)) {
    /* Handle error */
  } else {
    d_b = (double)big_d;
  }  
}

...