Examples using... constant.BinaryOp()
Recent
Package constant implements Values representing untyped
Go constants and their corresponding operations.
Sign returns -1, 0, or 1 depending on whether x < 0, x == 0, or x > 0;
x must be numeric or Unknown. For complex values x, the sign is 0 if x == 0,
otherwise it is != 0. If x is Unknown, the result is 1.
BinaryOp returns the result of the binary expression x op y.
The operation must be defined for the operands. If one of the
operands is Unknown, the result is Unknown.
BinaryOp doesn't handle comparisons or shifts; use Compare
or Shift instead.