No subject
Fred Tydeman
sun!uunet.UU.NET!ibmsupt!ibmpa!tydeman
Mon Sep 10 09:05:15 PDT 1990
Subject: Should atof and/or scanf set errno if strtod sets errno?
Consider the statements:
i = sscanf( "1e9999", "%lf", &double_var );
double_var = strtod( "1e9999", (char **)NULL);
double_var = atof( "1e9999" );
on a machine where 1e9999 is bigger than DBL_MAX, ie, overflows.
errno should be set to ERANGE by strtod. What should happen
to errno for atof and sscanf?
More information about the Numeric-interest
mailing list