Faster Integer.sqrt for large bignum

Integer.sqrt uses Newton's method.
This pull request reduces the precision which was unnecessarily high in each calculation step.
This commit is contained in:
tompng 2024-03-17 23:03:38 +09:00 committed by Nobuyoshi Nakada
parent dcfbe36cb5
commit 0ff2c7fe6f
3 changed files with 13 additions and 70 deletions

View file

@ -5169,7 +5169,7 @@ fix_rshift(long val, unsigned long i)
*
*/
static VALUE
VALUE
rb_int_rshift(VALUE x, VALUE y)
{
if (FIXNUM_P(x)) {