onetrueawk / awk

One true awk
Other
2.01k stars 160 forks source link

Rework floating point conversions. #98

Closed arnoldrobbins closed 3 years ago

arnoldrobbins commented 3 years ago
  1. Revise the is_number routine to return more information via optional pointer arguments. In particular this lets us avoid converting string to floating point twice every time, yielding a general speedup.
  2. Use is_number to filter out hexadecimal values and to enforce use of +nan, -nan, +inf, and -inf for NaN and infinity values, a la gawk.
  3. Revised getfval to use information from is_number w.r.t. is the string wholely a number (123.45) or has a leading numeric component (123abc). The latter is allowed when converting from string to floating point but not at other points in the awk code
  4. Add a section to the man page at the end explaining all this. Is this much doc needed?