IEEE-754:有理数集的基数

syn*_*gma 1 floating-point ieee-754

有理数集的基数是什么?这些有理数具有与单精度IEEE-754兼容的浮点格式的精确表示?

Pas*_*uoq 5

有2139095039个有限的正浮点数。有有限的负浮点数。

您要将+0.0和-0.0包括为两项还是一项?根据答案的不同,总数为2 * 2139095039 + 2或2 * 2139095039 +1,分别为4278190080或4278190079。

2139095039编号的来源:

#include <float.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int main(void) {
  float f = FLT_MAX;
  unsigned int i;
  memcpy(&i, &f, 4);
  printf("%u\n", i);
}
Run Code Online (Sandbox Code Playgroud)