Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: changed float to double and trimmed examples

...

Code Block
bgColor#FFCCCC
#include <stdio.h>

int main() {
  float x = 1/3.0;
  printf("Original      : %e\n", x);
  x = x * 7e-45;
  printf("Denormalized? : %e\n", x);
  x = x / 7e-45;
  printf("Restored      : %e\n", x);
}

This code produces the following output

...

Code Block
bgColor#ccccff
#include <stdio.h>
#include <stdio.h>

int main() {
  float double x = 1/3.0;
  printf("Original      : %e\n", x);
  x = x * 7e-45;
  printf("Denormalized? : %e\n", x);
  x = x / 7e-45;
  printf("Restored      : %e\n", x);
}
Code Block
Original      : 3.333333e-01
Denormalized? : 2.333333e-45
Restored      : 3.333333e-01

...