solana-program-library/libraries/math/src
Jon Cinque d336b8b714
stake-pool: Use checked_ceil_div for withdraw calc (#1482)
* stake-pool: Use checked_ceil_div for withdraw calc

When a stake account is totally removed from a stake pool by the
manager, there's a chance that the operation would not take enough of
the manager's pool tokens by 1 due to truncation.

Do a ceiling division instead, and refactor ceiling division into the
math library.

* Use new function name on CLI

* Cargo fmt
2021-03-23 00:33:51 +01:00
..
approximations.rs spl-math: Add separate package to test instruction usage (#1205) 2021-02-10 17:40:54 +01:00
checked_ceil_div.rs stake-pool: Use checked_ceil_div for withdraw calc (#1482) 2021-03-23 00:33:51 +01:00
entrypoint.rs spl-math: Add separate package to test instruction usage (#1205) 2021-02-10 17:40:54 +01:00
error.rs spl-math: Add separate package to test instruction usage (#1205) 2021-02-10 17:40:54 +01:00
instruction.rs Add bpf float performance tests (#1425) 2021-03-10 01:40:39 +00:00
lib.rs stake-pool: Use checked_ceil_div for withdraw calc (#1482) 2021-03-23 00:33:51 +01:00
precise_number.rs Bump Rust version to 1.50.0 2021-03-16 22:22:59 -07:00
processor.rs Float perf feedback (#1428) 2021-03-10 22:04:30 +00:00
uint.rs Remove unknown_clippy_lints 2021-03-16 18:33:37 -07:00