Skip to content

Add a "use float" pragma [feature] #17813

@richardleach

Description

@richardleach

Perl has an integer pragma, which directs the compiler to use integer operations from the point of use to the end of the enclosing BLOCK. Besides the user-visible behaviour, described at https://perldoc.perl.org/integer.html, perl will then use integer-specific versions of various operators. (e.g. pp_i_add, rather than the general purpose pp_add.)

A useful feature might be a corresponding float pragma, to force the compiler to use floating point operations.

This would entail the likes of:

  • Modifying the parser/lexer (?) to recognise the pragma
  • Adding new floating point ops
  • Adding new tests
  • All the fixups and regens that go with the above.

Benefits to users who want this:

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