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

avoid string operations on numbers #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shaydo-deriv
Copy link

multiple methods use regex to check if input argument is a number, this is rather inefficient and to add to that if it is not a number, these methods simply return unchanged input value without indicating an error in any way.

_round_to_precision method in addition to that converts $precision value to a string for the sake of rounding it, prepends it with "-" and then parses the result back to number. This logic is hard to understand and it is also not very efficient.

multiple methods use regex to check if input argument is a number, this
is rather inefficient and to add to that if it is not a number, these
methods simply return unchanged input value without indicating an error
in any way.

_round_to_precision method in addition to that converts $precision value
to a string for the sake of rounding it, prepends it with "-" and then
parses the result back to number. This logic is hard to understand and
it is also not very efficient.
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.

1 participant