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

Float comparison optimization bug #6674

Open
mununki opened this issue Mar 13, 2024 · 0 comments
Open

Float comparison optimization bug #6674

mununki opened this issue Mar 13, 2024 · 0 comments

Comments

@mununki
Copy link
Member

mununki commented Mar 13, 2024

let fee = 1. == 1.
let feee = 1. === 1.
let fne = 1. != 1.
let fnee = 1. !== 1.
let fgte = 1. >= 1.
let fgt = 1. > 1.
let flte = 1. <= 1.
let flt = 1. < 1.

compiled to

var fee = true;
var feee = true;
var fne = false;
var fnee = 1 !== 1; // this should be false
var fgte = true;
var fgt = false;
var flte = true;
var flt = false;

The internal implementation of Js_exp_make.ml seems to be missing in the implementation that calls the functions int_comp -> int_equal = float_equal for %noteq. It would be nice to improve the missing optimizations and ambiguous function names of the lambda, lam conversion implementations for each comparison operator.

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