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

feat: Add Multiply-add function to compute x*y+z #3

Merged
merged 2 commits into from
Apr 10, 2024

Conversation

danielelli
Copy link
Contributor

Info

This PR adds a similar function method of C++'s fma cmath function.

What has been added is:

  • fma(x,y,z): computes and returns the result of x * y + z without losing precision of any intermediate results.

Example:

let x = 15.0
let y = 16.0
let z = 17.0
fma(x, y, z) // 257.0
  • test cases for fma() have been added to the test folder in it's own file.

image

@korbexmachina korbexmachina self-requested a review April 10, 2024 21:09
Copy link
Owner

@korbexmachina korbexmachina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything seems to be in order, thank you for adding a useful macro and submitting a pull request!

@korbexmachina
Copy link
Owner

Note: This should be published in the next minor version. (v0.2.0)

@korbexmachina korbexmachina merged commit da1841f into korbexmachina:main Apr 10, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants