|
13 | 13 | //! - "Operation" / "Op": Something that relates a routine to a function or is otherwise higher |
14 | 14 | //! level. `Op` is also used as the name for generic parameters since it is terse. |
15 | 15 |
|
| 16 | +use std::fmt; |
| 17 | + |
| 18 | +pub use shared::{ALL_OPERATIONS, FloatTy, MathOpInfo, Ty}; |
| 19 | + |
16 | 20 | use crate::{CheckOutput, Float, TupleCall}; |
17 | 21 |
|
| 22 | +mod shared { |
| 23 | + include!("../../libm-macros/src/shared.rs"); |
| 24 | +} |
| 25 | + |
18 | 26 | /// An enum representing each possible symbol name (`sin`, `sinf`, `sinl`, etc). |
19 | 27 | #[libm_macros::function_enum(BaseName)] |
20 | | -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] |
| 28 | +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] |
21 | 29 | pub enum Identifier {} |
22 | 30 |
|
| 31 | +impl fmt::Display for Identifier { |
| 32 | + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 33 | + f.write_str(self.as_str()) |
| 34 | + } |
| 35 | +} |
| 36 | + |
23 | 37 | /// The name without any type specifier, e.g. `sin` and `sinf` both become `sin`. |
24 | 38 | #[libm_macros::base_name_enum] |
25 | | -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] |
| 39 | +#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] |
26 | 40 | pub enum BaseName {} |
27 | 41 |
|
| 42 | +impl fmt::Display for BaseName { |
| 43 | + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 44 | + f.write_str(self.as_str()) |
| 45 | + } |
| 46 | +} |
| 47 | + |
28 | 48 | /// Attributes ascribed to a `libm` routine including signature, type information, |
29 | 49 | /// and naming. |
30 | 50 | pub trait MathOp { |
|
0 commit comments