Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion factorion-math/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "factorion-math"
version = "1.0.3"
version = "1.0.4"
edition = "2024"
description = "The math (factorials and related functions) used by factorion"
license = "MIT"
Expand Down
5 changes: 4 additions & 1 deletion factorion-math/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,10 @@ pub fn approximate_termial_digits_float(k: u32, n: Float) -> Integer {
/// Will panic if `x` is not finite.
pub fn adjust_approximate((x, e): (Float, Integer)) -> (Float, Integer) {
let prec = x.prec();
let (extra, _) = (x.clone().ln() / Float::with_val(prec, 10).ln())
if x == 0.0 {
return (Float::with_val(prec, 0), Integer::ZERO.clone());
}
let (extra, _) = (x.clone().abs().ln() / Float::with_val(prec, 10).ln())
.to_integer_round(rug::float::Round::Down)
.unwrap_or_else(|| panic!("Got non-finite number, x was {x}"));
let x = x / (Float::with_val(prec, 10).pow(extra.clone()));
Expand Down
Loading