Skip to content

[Feature] Add integer type #443

Open
@Ph0enixKM

Description

@Ph0enixKM

Is your feature request related to a problem? Please describe.
Amber has no way to represent integer types. Sometimes we may want to accept type that can be represented as an integer. Here are main pros:

  • Not every environment comes with bc installed
  • Sometimes some calculations have to be done quickly and so calling bc will only slow things down

Describe the solution you'd like

  • Add Int data type
  • Numeric value that contains . symbol is a Num
  • Numeric value that is an integer is an Int
  • Handle as and is operator with Int
  • Add arithmetic operations for Int values
  • len builtin now returns Int value
  • fail statement only accepts Int value
  • status returns an Int
  • Accessor expression accepts an Int instead of Num
  • Ranges now work on Int instead of Num
  • Lexical comparison works only on Int arrays
  • Update documentation covering Int data type

Describe alternatives you've considered
N/A

Additional context
#70

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions