rust-num / num-traits

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

`TotalOrder` trait for floating point numbers #295

Closed andrewjradcliffe closed 10 months ago

andrewjradcliffe commented 10 months ago

Define an orthogonal trait which corresponds to the totalOrder predicate the IEEE 754 (2008 revision) floating point standard.

In order to maintain coherence, the bounds on TotalOrder should most likely be TotalOrder: Float (or TotalOrder: FloatCore). Without type constraints, TotalOrder could be defined on, well, anything. Though slightly ugly, one way to deal with this is to define two traits, TotalOrderCore: FloatCore and TotalOrder: Float. On the other hand, Inv has no such constraints (due to the possibility of a meaningful implementation on rational numbers). If the crate designers could weigh in on whether to introduce constraints, that would be helpful.

Resolves: issue#256

cuviper commented 10 months ago

Thanks!

bors r+

bors[bot] commented 10 months ago

Build failed:

cuviper commented 10 months ago

bors r+

bors[bot] commented 10 months ago

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here. For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

TESLA-SATI commented 3 months ago

1554 - push