Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng: implement untyped-float divisions #191

Closed
sbinet opened this issue Jan 7, 2018 · 0 comments
Closed

ng: implement untyped-float divisions #191

sbinet opened this issue Jan 7, 2018 · 0 comments

Comments

@sbinet
Copy link
Collaborator

sbinet commented Jan 7, 2018

the following fails in ng:

ng> x:=4.0
ng> y:=2.0
ng> x/y
float64(2)
ng> 4.0/2.0
ng eval panic: binOp type mismatch Left: +4 (eval.UntypedFloat), Right: +2 (eval.UntypedFloat) op: /
goroutine 1 [running]:
runtime/debug.Stack(0x65, 0x0, 0x0)
	/usr/lib/go/src/runtime/debug/stack.go:24 +0xa7
runtime/debug.PrintStack()
	/usr/lib/go/src/runtime/debug/stack.go:16 +0x22
neugram.io/ng/eval.(*Program).Eval.func1(0xc4200ae480, 0xc420113610, 0xc4201135f8)
	/home/binet/work/gonum/src/neugram.io/ng/eval/eval.go:516 +0x222
panic(0xb88620, 0xc420011260)
	/usr/lib/go/src/runtime/panic.go:491 +0x283
neugram.io/ng/eval.binOp(0xb, 0xc41fc0, 0xc42016e4b0, 0xc41fc0, 0xc42016e510, 0x1, 0xc4200e81e0, 0x8e, 0x0)
	/home/binet/work/gonum/src/neugram.io/ng/eval/op.go:577 +0x6c79
neugram.io/ng/eval.(*Program).evalExpr(0xc4200ae480, 0x1151c40, 0xc42005b800, 0x0, 0x0, 0x0)
	/home/binet/work/gonum/src/neugram.io/ng/eval/eval.go:1521 +0x360d
neugram.io/ng/eval.(*Program).evalStmt(0xc4200ae480, 0x1152640, 0xc42016e570, 0x0, 0x0, 0x0)
	/home/binet/work/gonum/src/neugram.io/ng/eval/eval.go:925 +0x4655
neugram.io/ng/eval.(*Program).Eval(0xc4200ae480, 0x1152640, 0xc42016e570, 0xc4200761e0, 0x0, 0x0, 0x0, 0x114b5c0, 0xc420011270)
	/home/binet/work/gonum/src/neugram.io/ng/eval/eval.go:537 +0x38c
main.handleResult(0x1, 0xc420011250, 0x1, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	/home/binet/work/gonum/src/neugram.io/ng/ng.go:393 +0x7ff
main.loop(0xc400000000)
	/home/binet/work/gonum/src/neugram.io/ng/ng.go:385 +0x611
main.main()
	/home/binet/work/gonum/src/neugram.io/ng/ng.go:147 +0x641
ng: ng eval panic: binOp type mismatch Left: +4 (eval.UntypedFloat), Right: +2 (eval.UntypedFloat) op: /
sbinet added a commit to sbinet-gonum/ng that referenced this issue Jan 8, 2018
sbinet added a commit to sbinet-gonum/ng that referenced this issue Jan 8, 2018
sbinet added a commit to sbinet-gonum/ng that referenced this issue Jan 15, 2018
sbinet added a commit that referenced this issue Jan 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant