Mauro Lacy
Mauro Lacy
Here's how to reproduce: ```rust $ evcxr Welcome to evcxr. For help, type :help >> :dep rust_decimal = { version = "1.16", default-features = false, features = ["maths"] } >>...
> `Decimal` tries to maintain decimal digits, so after a few iterations, it is possible for the number of digits to overflow, even though the number gets smaller. If you...
Also, I've noticed that `sqrt()` doesn't suffer from this. Or at least, its range of application is order of magnitudes larger than that of `powd`. So, `powd` can for sure...
> if you want `exp` or `pow` to work over a full range of 32-bit numbers, you may need more than the 96 bits that this crate is keeping. In...
The problem is a `checked_mul` overflow, in https://github.com/paupino/rust-decimal/blob/master/src/maths.rs#L187. I guess there's not much to do, except for increasing the number of bits, or improving / optimizing the impl somehow (if...
Thanks for the detailed explanation. I tried the "normalizing" approach mentioned above (basically, calling `term.normalize_assign()` before / after `checked_mul`) to no avail.
OK, best solution for me is to dump the last term (27) of the power series when computing the exponential. That introduces an error of roughly one decimal digit, but...
Of course, I can always do: ```rust for n in 2..=27 { term = term.checked_mul(self.div(Decimal::new(n, 0)))?; let next = result + term; let diff = (next - result).abs(); result =...
Why not? If you do everything correctly, that should work. In general, and please correct me if I'm wrong, the only memory that will not be deallocated or GC'd is...
Hello, I don't know much about `DefineClass`, but this looks like a sensible use for an `AutoByteArray`. In particular, the (admittedly scarce) documentation for [DefineClass](https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/functions.html#DefineClass) says: _The buffer containing the...