rust/library
bors b8536c1aa1 Auto merge of #116176 - FedericoStra:isqrt, r=dtolnay
Add "integer square root" method to integer primitive types

For every suffix `N` among `8`, `16`, `32`, `64`, `128` and `size`, this PR adds the methods

```rust
const fn uN::isqrt() -> uN;
const fn iN::isqrt() -> iN;
const fn iN::checked_isqrt() -> Option<iN>;
```

to compute the [integer square root](https://en.wikipedia.org/wiki/Integer_square_root), addressing issue #89273.

The implementation is based on the [base 2 digit-by-digit algorithm](https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Binary_numeral_system_(base_2)) on Wikipedia, which after some benchmarking has proved to be faster than both binary search and Heron's/Newton's method. I haven't had the time to understand and port [this code](http://atoms.alife.co.uk/sqrt/SquareRoot.java) based on lookup tables instead, but I'm not sure whether it's worth complicating such a function this much for relatively little benefit.
2023-09-29 07:35:44 +00:00
..
alloc Auto merge of #114041 - nvzqz:nvzqz/shared_from_array, r=dtolnay 2023-09-28 06:16:01 +00:00
backtrace@99faef833f Bump backtrace to 0.3.69 2023-08-22 15:01:14 -07:00
core Auto merge of #116176 - FedericoStra:isqrt, r=dtolnay 2023-09-29 07:35:44 +00:00
panic_abort Rebase to master 2023-09-22 17:23:33 +05:30
panic_unwind Rename BoxMeUp to PanicPayload. 2023-09-20 19:24:52 +02:00
portable-simd remove repetitive words 2023-07-31 16:13:02 +08:00
proc_macro Auto merge of #116124 - WaffleLapkin:fix-proc-macro-literal-to-string, r=compiler-errors 2023-09-26 03:39:25 +00:00
profiler_builtins Bump cfg(bootstrap) 2023-08-23 20:05:14 -04:00
rtstartup
rustc-std-workspace-alloc
rustc-std-workspace-core
rustc-std-workspace-std
std Auto merge of #114882 - ChrisDenton:riddle-me, r=dtolnay 2023-09-28 13:35:36 +00:00
stdarch@6100854c4b Bump stdarch submodule 2023-09-05 19:56:20 +02:00
sysroot
test Bump cfg(bootstrap) 2023-08-23 20:05:14 -04:00
unwind added support for GNU/Hurd 2023-09-21 17:31:25 +02:00