MCPcopy Create free account
hub / github.com/egonelbre/exp / mul

Function mul

vector/generate/expr.go:11–21  ·  view source on GitHub ↗

TODO: handle operation order

(a, b Expr)

Source from the content-addressed store, hash-verified

9// TODO: handle operation order
10
11func mul(a, b Expr) Expr {
12 as := a.String()
13 bs := b.String()
14 if as == "1" {
15 return Expr{Expr: bs}
16 }
17 if bs == "1" {
18 return Expr{Expr: as}
19 }
20 return Expr{Expr: as + " * " + bs}
21}
22
23func add(a, b Expr) Expr {
24 as := a.String()

Callers 5

IterateMethod · 0.85
advanceIteratorsMethod · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected