This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
Since, according to the standard, the behavior of num_get is "as-if" scanf, not "as-if" strtof, and scanf certainly doesn't fail in any sense in case of floating point underflow (at least this is what I'm seeing on linux), I would guess we could just avoid checking whether errno == ERANGE, don't fiddle at all with errno, and instead just check that the value returned by strtof is != HUGE_VAL && != -HUGE_VAL.
Or dot we have reasons to believe people are relying (uncorrectly) on
failbit being set in case of underflow? When evaluating this issue, we should also consider that, according to C99, 7.20.1.3/10, about strtof & co, in case of underflow "whether errno acquires the value ERANGE is is implementation-defined". Thus, I would say I do not consider the latter expectation very reasonable, in general.
best, benjamin
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |