Closed
Description
Feature gate: #![feature(isqrt)]
This is a tracking issue for the functions {u8,u16,u32,u64,i128,usize}::isqrt
and {i8,i16,i32,i64,i128,isize}::{isqrt,checked_isqrt}
, which compute the integer square root, addressing issue #89273.
Public API
For every suffix N
among 8
, 16
, 32
, 64
, 128
and size
, the feature isqrt
introduces the methods
const fn uN::isqrt() -> uN;
const fn iN::isqrt() -> iN;
const fn iN::checked_isqrt() -> Option<iN>;
Expand to see the full API
const fn u8::isqrt() -> u8;
const fn i8::isqrt() -> i8;
const fn i8::checked_isqrt() -> Option<i8>;
const fn u16::isqrt() -> u16;
const fn i16::isqrt() -> i16;
const fn i16::checked_isqrt() -> Option<i16>;
const fn u32::isqrt() -> u32;
const fn i32::isqrt() -> i32;
const fn i32::checked_isqrt() -> Option<i32>;
const fn u64::isqrt() -> u64;
const fn i64::isqrt() -> i64;
const fn i64::checked_isqrt() -> Option<i64>;
const fn u128::isqrt() -> u128;
const fn i128::isqrt() -> i128;
const fn i128::checked_isqrt() -> Option<i128>;
const fn usize::isqrt() -> usize;
const fn isize::isqrt() -> isize;
const fn isize::checked_isqrt() -> Option<isize>;
Steps / History
- Forum discussion history:
- Implementation: Add "integer square root" method to integer primitive types #116176
- Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- None yet.