You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The trait math::num::RealNumber is largely based on num-traits Float. This is the biggest obstacle in bringing rust_decimal:: Decimal into Smartcore so far, but it is possible if you are willing to refactor Smartcore's code a bit.
One way you can do it is by working together with the author of rust_decimal, Paul Mason, to see whether is it possible to add implementation of num_traits::float::Float for rust_decimal::Decimal. Please note that you won't be able to keep implementation of num_traits::float::Float for rust_decimal::Decimal in Smartcore since Rust won't let you implement a trait on a type if both the trait and the type are not local to the crate.
Anther possibility is to refactor Smartcore's code and get rid of Float in the signature of math::num::RealNumber by moving all the methods we need from Float directly into the trait.
I would start from reaching out to Paul to discuss possibility of extending rust_decimal::Decimal with implementation of Float. If it is not possible I would consider refactoring Smartcore.
I want to deploy smartcore without using floating-point numbers. I'll try to change the crate math::num::RealNumber to support rust_decimal.
Do you think it's possible to have something like
impl RealNumber for Decimal
in the trait inRealNumber
or would a completely new trait be necessary?The text was updated successfully, but these errors were encountered: