Bikeshedding: BigInt.sqrt
/cbrt
vs. BigInt.isqrt
/icbrt
#26
Labels
question
Further information is requested
BigInt.sqrt
/cbrt
vs. BigInt.isqrt
/icbrt
#26
Most programming languages that include the integer square root use the name
isqrt
instead ofsqrt
. Some of them do usesqrt
for integer square roots.isqrt
in generic namespace: Common Lisp, Crystal, Julia, Maple, PARI/GP*, Python, Racket*, SageMath, Scheme*, Tclisqrt
in integer namespace/class: Rustsqrt
in integer namespace/class: Chapel, Java, Ruby, Zig(Languages marked with * spell out
isqrt
using words likeinteger-sqrt
.)Notably, if we name the BigInt root functions
BigInt.isqrt
/icbrt
instead ofBigInt.sqrt
/cbrt
, then this would point towards also including aMath.isqrt
/icbrt
for numbers.BigInt.sqrt
/cbrt
vs.BigInt.isqrt
/icbrt
?BigInt.isqrt
/icbrt
, then, in a future proposal (not this one), should we considerMath.isqrt
/icbrt
for numbers?I would personally like integer square roots to consistently be
isqrt
across both bigints (BigInt.isqrt
) and numbers (Number.isqrt
). If integer square roots are useful on bigints, then they'd be useful on integer numbers too.CC: @bakkot, @waldemarhorwat, @ljharb
The text was updated successfully, but these errors were encountered: