Skip to content

Add log and atan2 operations for floats #583

@nicolas-abril

Description

@nicolas-abril

HVM exposes log and atan2 operations, but they're not available in Bend except as a hack (using | and & operators).
We should expose them to users with a native operation.

I don't know what syntax to use other than log(a, b) and (log a b), but I don't really like it since it is different from all the other operators.

There multiple way to implement this:

  • Parsing log(a, b) as a numeric operation.
  • Defining a builtin function log a b = a & b. This is a bit of a hack and I don't love it, but it's the simplest.
  • Having a builtin stub log a b that gets converted into the numeric operation as a compiler pass.

Metadata

Metadata

Assignees

Labels

HVMAbout the HVMenhancementNew feature or requestpreludeBend's builtin types and functionssyntaxAbout Bend's syntax

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions