INNER CODE UNIT · Go

Divide

expr-lang/expr · vm/runtime/helpers/main.go:319

func Divide(a, b interface{}) float64 {
	switch x := a.(type) {
	{{ cases "/" }}
	}
	panic(fmt.Sprintf("invalid operation: %T / %T", a, b))
}

func Modulo(a, b interface{}) int {
	switch x := a.(type) {
	{{ cases_int_only "%" }}
	}
	panic(fmt.Sprintf("invalid operation: %T %% %T", a, b))
}
`

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…