> Jarkko Hietaniemi <jhi@iki.fi> writes: > >Okay, I must be blind. But I blame the whoever it was who wrote > >sv_chop() for not using SvOOK_on(sv) :-) ah, yes. I grepped for SvOOK_on (and didn't notice anything interesting about SVf_OOK being on the right of an = sign sv.c says: /* * we return IS_NUMBER_TO_INT_BY_ATOL if the number can be converted * to _integer_ with atol() and IS_NUMBER_TO_INT_BY_ATOF if you need * (int)atof(). */ I can't think any situation where (int)atof() would give you an answer better than atol() for a number matching /[-+]?[0-9]+/ [currently looks_like_number returns either just IS_NUMBER_TO_INT_BY_ATOL or IS_NUMBER_TO_INT_BY_ATOF | IS_NUMBER_NOT_IV] Am I missing something obscure (or obvious)? If you know that the string you're converting to the number is an integer (possibly greater than the largest int) why use (int)atof() at all, as atol() returns LONG_MAX on overflow, which is what we want the cast to do. [forgive my/that comment's lax terminology. s/int/long/g; and I think there are no problems when sizeof(int) != sizeof(long)] Nicholas ClarkThread Previous | Thread Next