// Compile: cc -std=c23 test_7_5_errno.c
#include <errno.h>
#include <math.h>
#include <stdlib.h>
#include <assert.h>

int main(void) {
  errno = 0;
  volatile char buf[1024];
  // very large exponent to overflow to HUGE_VAL
  double x = strtod("1e1000000", NULL);
  (void)x;
  assert(errno == ERANGE);
  return 0;
}
