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

Add NaN and Inf checking to MPFR functions #265

Merged
merged 1 commit into from
Oct 16, 2024
Merged

Conversation

jmcardon
Copy link
Member

PR checklist:

  • Test coverage for the proposed changes
  • Added case to ops.repl
  • PR description contains example output from repl interaction or a snippet from unit test output
  • (If Relevant) Documentation has been (manually) updated at https://docs.kadena.io/pact

Additionally, please justify why you should or should not do the following:

  • Benchmark regressions
  • Confirm replay/back compat (Ignore until core release)
  • (For Kadena engineers) Run integration-tests against a Chainweb built with this version of Pact (Ignore until core release)

@@ -157,6 +157,17 @@ foreign import ccall "mpfr_exp"
foreign import ccall "mpfr_sqrt"
c'mpfr_sqrt :: Mpfr_t -> Mpfr_t -> CInt -> IO ()

foreign import ccall "mpfr_number_p"
Copy link
Member Author

Choose a reason for hiding this comment

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

mpfr_number_p just for review's sake: checks whether the operand returned is a number, and not NaN or Inf.

foreign import ccall "mpfr_nan_p"
c'mpfr_nan_p :: Mpfr_t -> IO CInt

foreign import ccall "mpfr_sgn"
Copy link
Member Author

Choose a reason for hiding this comment

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

Checks the sign of the operand, if > 0 then it's positive.

@jmcardon jmcardon merged commit 420a113 into master Oct 16, 2024
14 checks passed
@jmcardon jmcardon deleted the jose/mpfr_inf branch October 16, 2024 14:38
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