Skip to content

Float comparison optimization bug #6674

Closed as not planned
Closed as not planned

Description

@mununki
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.

Activity

  1. github-actions commented on Aug 30, 2025

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  2. added
    stale
    on Aug 30, 2025
  3. removed
    stale
    on Sep 1, 2025
  4. github-actions commented on Aug 28, 2026

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

  5. added
    stale
    on Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementstale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions