Floating-point arithmetic are not allowed in substrate runtime.
f64 has an pub fn ln(self) -> f64
to calculate natural log. How can I do that in substrate without using floating points.
Floating-point arithmetic are not allowed in substrate runtime.
f64 has an pub fn ln(self) -> f64
to calculate natural log. How can I do that in substrate without using floating points.
There is a great library to handle the float calculation.
For your case, you can use substrate_fixed::transcendental::ln
.
e
also know as natural? What accuracy do you need in the result and why?