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

Export sigexp #138

Merged
merged 1 commit into from
Jun 16, 2020
Merged

Export sigexp #138

merged 1 commit into from
Jun 16, 2020

Conversation

jmkuhn
Copy link
Contributor

@jmkuhn jmkuhn commented Jun 11, 2020

I opted to have this return Integers instead of floating point values. Most uses of this function are probably looking for integers and this avoids the inefficiency of converting an integer to floating point which the user immediately converts back to integer. One consequence of returning integers is that this function throws a DomainError for Inf or NaN inputs. The user would need to check for and handle these values anyway; this just encourages the check before calling sigexp.

julia> sigexp(d64"-1.25")
(-1, 125, -2)

julia> sigexp(d64"1")
(1, 1, 0)

julia> sigexp(d64"1.0")
(1, 10, -1)

Fixes #130
cc @quinnj

Copy link
Collaborator

@quinnj quinnj left a comment

Choose a reason for hiding this comment

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

LGTM!

@stevengj stevengj merged commit 78ed076 into JuliaMath:master Jun 16, 2020
@jmkuhn jmkuhn deleted the sigexp branch June 16, 2020 22:30
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.

export sigexp()
3 participants