Class: Rucas::Symbolic::NegExpr

Inherits:
UnaryOpExpr show all
Defined in:
lib/rucas/symbolic.rb

Constant Summary

Constants included from OpExpr

OpExpr::OP_PRECEDENCE

Instance Attribute Summary

Attributes inherited from UnaryOpExpr

#op, #rhs

Instance Method Summary collapse

Methods inherited from UnaryOpExpr

#children, #match, #to_s_paren, #value

Methods included from OpExpr

#constant?, #precedence, #rewrite, #with

Methods included from Expr

#children, make, #match, #precedence, #rewrite, #simplify, #to_s_paren, #value

Instance Method Details

#to_sObject



118
# File 'lib/rucas/symbolic.rb', line 118

def to_s; rhs.precedence < self.precedence ? "-(#{rhs})" : "-#{rhs}" end