Skip to content

%intoffloat inconsistency #6739

Closed as not planned
Closed as not planned

Description

@mununki
let i0 = (22130921800000. -. 0.)->Belt.Float.toInt
let i1 = (22130921800000.)->Belt.Float.toInt

generates

var i0 = 22130921800000 - 0 | 0; // -1044676288
var i1 = 2147483647; // max value of Int32

i1 is converted from Int32.of_float by the lam optimization, which seems to result in a platform-dependent value. How about treating it the same as i0 instead?

var i0 = 22130921800000 - 0 | 0; // -1044676288
var i1 = 22130921800000 | 0; // -1044676288

Activity

  1. github-actions commented on Apr 17, 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 Apr 17, 2025
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

    stale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions