Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Float.== in Inko #584

Closed
yorickpeterse opened this issue Jul 5, 2023 · 0 comments
Closed

Implement Float.== in Inko #584

yorickpeterse opened this issue Jul 5, 2023 · 0 comments
Assignees
Labels
accepting contributions Issues that are suitable to be worked on by anybody, not just maintainers compiler Changes related to the compiler feature New things to add to Inko, such as a new standard library module runtime Changes related to the Rust-based runtime library std Changes related to the standard library
Milestone

Comments

@yorickpeterse
Copy link
Collaborator

Description

Float.== calls out to inko_float_eq, incurring a function call cost. We should be able to implement this function in pure Inko, and the only missing bit is Rust's f64::is_sign_positive, which too can be implemented in Inko.

Thus, the steps would be:

  1. Add Float.sign_negative?
  2. Add Float.sign_positive? (this simply inverts the result of Float.sign_negative?)
  3. Replace the call to inko_float_eq with pure Inko code

This should be done after #578 is merged, otherwise said pull request may run into a bunch of merge conflicts that I'd like to avoid.

Related work

No response

@yorickpeterse yorickpeterse added accepting contributions Issues that are suitable to be worked on by anybody, not just maintainers feature New things to add to Inko, such as a new standard library module compiler Changes related to the compiler std Changes related to the standard library runtime Changes related to the Rust-based runtime library labels Jul 5, 2023
@yorickpeterse yorickpeterse self-assigned this Jul 14, 2023
@yorickpeterse yorickpeterse added this to the 0.13.0 milestone Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepting contributions Issues that are suitable to be worked on by anybody, not just maintainers compiler Changes related to the compiler feature New things to add to Inko, such as a new standard library module runtime Changes related to the Rust-based runtime library std Changes related to the standard library
Projects
None yet
Development

No branches or pull requests

1 participant