rust-num / num-traits

Numeric traits for generic mathematics in Rust
Apache License 2.0
699 stars 131 forks source link

[feature request] Remove `Copy` bound from `Real` #245

Open CraftSpider opened 2 years ago

CraftSpider commented 2 years ago

Basically the reverse request of #243 - Currently, Real implies Copy, which restricts it from being implemented for real-value types that use non-copy internals (for example, a type that represents values as whole fractions backed by a BigInt). The Copy bound doesn't seem to be actually useful to the trait, and more like a holdover from when it was split out from Float.

This would be a breaking change unfortunately.

CraftSpider commented 2 years ago

Just an added thought - If this change is made, it may be a good time to add Bounded as a super-trait and remove the min_value and max_value methods, as they're documented to do the same things