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

Fix OpDivide: change resulting type to float64 #272

Merged
merged 1 commit into from
Nov 5, 2022

Conversation

Dentrax
Copy link
Contributor

@Dentrax Dentrax commented Nov 4, 2022

Fixes #270

Signed-off-by: Furkan [email protected]

Added all possible / tests for different types, and it's working as expected now. Also I had to add runtime.ToFloat64() for OpDivide, otherwise it rounds up the value and converts float32. For example:

- float32(0.96039605)
+ float64(0.9603960514068604)

- is wrong, + is correct value (with runtime.ToFloat64).

cc @antonmedv

@Dentrax Dentrax changed the title Fix DivideOp: change resulting type to float64 Fix OpDivide: change resulting type to float64 Nov 4, 2022
@antonmedv
Copy link
Member

Nice. But please update generator of helpers.

@Dentrax
Copy link
Contributor Author

Dentrax commented Nov 4, 2022

Ah, sure boss! Didn't notice it! Now it's done.

expr_test.go Outdated Show resolved Hide resolved
vm/vm.go Outdated Show resolved Hide resolved
@antonmedv
Copy link
Member

Gonna fix tests on my own.

@antonmedv antonmedv merged commit bd73b5a into expr-lang:master Nov 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants