Skip to content

(1073741824 = -1073741824) is true ! #3582

@vicuna

Description

@vicuna

Original bug ID: 3582
Reporter: administrator
Status: resolved (set by @damiendoligez on 2016-12-07T15:13:36Z)
Resolution: won't fix
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Related to: #3302 #4210
Monitored by: dsheets

Bug description

Full_Name: Thomas de Grivel
Version: 3.08.2
OS: debian
Submission from: robinson-2-82-67-155-88.fbx.proxad.net (82.67.155.88)

The integer literal 1073741824 is accepted even if it is outside the range of
representable integers.

In the ocaml 3.08.2 toplevel:

1073741824;;

  • : int = -1073741824

1073741824 = -1073741824;;

  • : bool = true

It really should fail just like it's successor :

1073741825;;

Integer literal exceeds the range of representable integers of type int

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions