|
From:
<br...@ph...> - 2005-06-09 04:46:23
|
Ethan Merritt wrote:
> On Wednesday 08 June 2005 03:53 pm, Robert Hart wrote:
> I think I'll remove that OSK chunk altogether,
Please don't. It's quite harmless as it is --- it'll only be used on
one platform, and you would risk breaking that platform completely by
doing this.
> and make the NO_FORTRAN_NUMS a run-time option. Probably
> set datafile {no}fortran_floats
OK.
>>In the NO_FORTRANS_NUMS code path, atof is used to get the next
>>float. This is much faster than sscanf.
Is it? Why would that be? More to the point, atof has *no* error
handling capabilities, which I don't believe to be a good idea in this case.
> Are you saying that the speed gain could be achieved just by
> replacing sscanf with atof in the standard code path,
That wouldn't work at all --- atof leaves you with no way of knowing the
end of that number, no way to position to the next one, and no way to
find the 'D' in floating point number. sscanf() and its %n format are
used for a reason.
|