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

F/injective-math improvements #186

Merged
merged 27 commits into from
Nov 2, 2023
Merged

F/injective-math improvements #186

merged 27 commits into from
Nov 2, 2023

Conversation

DrunkenRandomWalker
Copy link
Collaborator

@DrunkenRandomWalker DrunkenRandomWalker commented Oct 25, 2023

  1. replaced bigint with primitive-types, because bigint is deprecated.
  2. improved exp, pow, and ln numerical precision to double precision.
  3. added newton's method, discrete_newton's method, halley's method for root finding.

@DrunkenRandomWalker DrunkenRandomWalker changed the title F/improvements F/injective-math improvements Oct 25, 2023
Copy link
Contributor

@maxrobot maxrobot left a comment

Choose a reason for hiding this comment

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

Seems like a good step to making the package better but can we:

  1. make sure there is a consistent interface

Meaning that all public functions are not underscored, and if they are not to be public the to perform that at the function definition level

Keep mathematical operations like power, exp, sqrt available.

  1. Also remove uncommented code

  2. There is use of unwrap which I think is unsafe, please make sure we are handling unwraps appropriately.

packages/injective-math/Cargo.toml Outdated Show resolved Hide resolved
packages/injective-math/src/fp_decimal/arithmetic.rs Outdated Show resolved Hide resolved
packages/injective-math/src/fp_decimal/exp.rs Outdated Show resolved Hide resolved
packages/injective-math/src/fp_decimal/exp.rs Outdated Show resolved Hide resolved
packages/injective-math/src/lib.rs Show resolved Hide resolved
@DrunkenRandomWalker
Copy link
Collaborator Author

Seems like a good step to making the package better but can we:

1. make sure there is a consistent interface

Meaning that all public functions are not underscored, and if they are not to be public the to perform that at the function definition level

Keep mathematical operations like power, exp, sqrt available.

2. Also remove uncommented code

3. There is use of unwrap which I think is unsafe, please make sure we are handling unwraps appropriately.

1 and 2 are done.

Copy link
Member

@gorgos gorgos left a comment

Choose a reason for hiding this comment

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

looks mostly good, although I cant go through the math in detail of course, hopefully the tests and us using the new version will be sufficient

packages/injective-math/src/fp_decimal/log.rs Outdated Show resolved Hide resolved
packages/injective-math/src/fp_decimal/log.rs Outdated Show resolved Hide resolved
packages/injective-math/src/fp_decimal/arithmetic.rs Outdated Show resolved Hide resolved
Copy link
Member

@gorgos gorgos left a comment

Choose a reason for hiding this comment

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

LGTM

@DrunkenRandomWalker DrunkenRandomWalker merged commit 466a3c7 into dev Nov 2, 2023
4 checks passed
@DrunkenRandomWalker DrunkenRandomWalker deleted the f/improvements branch November 2, 2023 17:29
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.

3 participants