root/regress/lib/libc/strtod/strtodtest.c
/*      $OpenBSD: strtodtest.c,v 1.2 2017/02/25 07:28:32 jsg Exp $      */
/* Public domain, Otto Moerbeek <otto@drijf.net>, 2006. */

#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <err.h>

/*
 * Checks if strtod() reports underflow.
 */

int
main()
{
        char *tmp="0.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002";
        double d;

        d = strtod(tmp, NULL);
        if (errno != ERANGE)
                errx(1, "errno = %d", errno);
        return (0);
}