Skip to content

Clarify definition of Int type #3047

Description

@hdgarrood

Currently, the docs for Prim say that Int is a 32-bit signed integer. However, in #1094, we seemed to be moving towards a consensus that the number of bits in an Int should be allowed to vary between platforms and backends.

Since there's a bit of confusion regarding this type (e.g. "Why doesn't it go up to Number.MAX_SAFE_INTEGER") I'd like to clarify this. I think the options are:

  • Decide that Int really is exactly 32 bits
  • Define Int as a twos-complement signed integer with at least 32 bits
  • something slightly different from either of these? I'm not sure.

Whatever we decide we should update the Prim docs appropriately.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions