use std::fmt::Display;
#[derive(Clone)]
pub enum IntBinOp {
Add,
Sub,
Mul,
Div,
SRem,
IShL,
SShR,
UShR,
Min,
Max,
BAnd,
BOr,
BXor,
BNand,
BNor,
BXnor,
}
impl Display for IntBinOp {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
IntBinOp::Add => write!(f, "add"),
IntBinOp::Sub => write!(f, "sub"),
IntBinOp::Mul => write!(f, "mul"),
IntBinOp::Div => write!(f, "div"),
IntBinOp::SRem => write!(f, "srem"),
IntBinOp::IShL => write!(f, "ishl"),
IntBinOp::SShR => write!(f, "sshr"),
IntBinOp::UShR => write!(f, "ushr"),
IntBinOp::Min => write!(f, "min"),
IntBinOp::Max => write!(f, "max"),
IntBinOp::BAnd => write!(f, "band"),
IntBinOp::BOr => write!(f, "bor"),
IntBinOp::BXor => write!(f, "bxor"),
IntBinOp::BNand => write!(f, "bnand"),
IntBinOp::BNor => write!(f, "bnor"),
IntBinOp::BXnor => write!(f, "bxnor"),
}
}
}
#[derive(Clone)]
pub enum FloatBinOp {
Add,
Sub,
Mul,
Div,
Rem,
Pow,
Atan2,
Log,
Min,
Max,
}
impl Display for FloatBinOp {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
FloatBinOp::Add => write!(f, "add"),
FloatBinOp::Sub => write!(f, "sub"),
FloatBinOp::Mul => write!(f, "mul"),
FloatBinOp::Div => write!(f, "div"),
FloatBinOp::Rem => write!(f, "rem"),
FloatBinOp::Pow => write!(f, "pow"),
FloatBinOp::Atan2 => write!(f, "atan2"),
FloatBinOp::Log => write!(f, "log"),
FloatBinOp::Min => write!(f, "min"),
FloatBinOp::Max => write!(f, "max"),
}
}
}