Skip to content

Implement and test exp for Ratio#291

Merged
iliekturtles merged 5 commits into
iliekturtles:masterfrom
jacg:exp-log
Mar 26, 2022
Merged

Implement and test exp for Ratio#291
iliekturtles merged 5 commits into
iliekturtles:masterfrom
jacg:exp-log

Conversation

@jacg

@jacg jacg commented Mar 23, 2022

Copy link
Copy Markdown
Contributor

Close #290.

Please have a look if this is up to standard. If so, I'd be happy to add exp2, ln, log, log2 and log10 in a similar fashion.

Comment thread src/si/ratio.rs Outdated
Comment on lines +80 to +82
/// Implementation of various stdlib exponentiation and logarithm functions
#[cfg(feature = "std")]
impl<U, V> Ratio<U, V>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Go ahead and merge this impl block with the trig block and update the comments. Same for the tests below. rename mod inv_trig to mod float and include all of the functions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

I have also included exp_m1 and ln_1p which weren't in the original list.

log takes a second argument, besides self. I've given it the same type as self but I'm not sure whether we want to be more flexible. So I've added that one in a separate commit.

I've also added [must_use = ...] to the inverse-trig functions which were already there. Also in a separate commit, in case you don't want it. The must_use is there from the beginning for all the new functions that I added.

@iliekturtles

Copy link
Copy Markdown
Owner

Things look good after a quick skim so I kicked off the test workflows. I'll review in full detail later today.

For the [must_use = ...] attributes I do want to keep them and will add a new issue to review other existing methods.

Comment thread src/si/ratio.rs Outdated
@iliekturtles iliekturtles merged commit 66d3e85 into iliekturtles:master Mar 26, 2022
@jacg jacg deleted the exp-log branch March 29, 2022 12:43
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.

Suport .exp() for Ratio

2 participants