lexical_util

Module step

Source
Expand description

The maximum digits that can be held in a u64 for a given radix without overflow.

This is useful for 128-bit division and operations, since it can reduces the number of inefficient, non-native operations.

§Generation

See etc/step.py for the script to generate the divisors and the constants, and the division algorithm.

Functions§

  • Get the maximum number of digits that can be processed without overflowing.
  • Get the maximum number of digits that can be processed without overflowing.
  • Calculate the number of digits that can be processed without overflowing a u64. Helper function since this is used for 128-bit division.