Skip to content

Conversation

@khwilliamson
Copy link
Contributor

These commits

  • add a calculation before the loop that saves calculations each iteration
  • replace floating multiplications each loop iteration with an integer increment, plus after the loop a call to ldexp

One question I have is can I just assume that Perl_ldexp exists and not have a fallback to Perl_pow? I think C99 requires all versions we need to be available, but it's not clear to me that perl.h guarantees one.

  • This set of changes does not require a perldelta entry.
Underscores in numbers are much less common than digits, and its
unlikely that this iteration of the loop through all the digits will
still have a running total of 0.
grok_bin_oct_hex: Move comments

And reflow.  This is in preparation for the next commit.
We can compute outside the loop the exact value at which the next
iteration wil overflow, saving some operations
This replaces a floating multiply each loop iteration with an integer
increment, plus after the loop completes, a call to ldexp() or pow().

Most of the floating multiplies are done on integral values, so
not much precision is lost, but this gets it down to just one
precision-losing operation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants