Skip to content

Conversation

@mispecto
Copy link

@mispecto mispecto commented Mar 7, 2021

The idea is to use decQuadReduce() function that eliminates insignificant zeroes from the number before hashing.

@jonathanstrong
Copy link
Collaborator

hey - just looking at this. thank you for submitting the pull request.

I did have one question, I'm not familiar with what trim/decNumberTrim does. I realize you switched to reduce, which makes sense, but is there an independent function of trim that we possibly want to offer for its own reasons?

@mispecto
Copy link
Author

mispecto commented Mar 9, 2021

@jonathanstrong hey, sorry I don't follow. Are you asking whether trim should be part of Rust API?

@jonathanstrong
Copy link
Collaborator

potentially? the C code has a comment describing decNumberTrim as "remove insignificant zeros", while the comment for decNumberReduce is "remove trailing zeros". I don't understand how these are different in terms of functionality, and would like to for the purposes of assessing whether the Rust api should also provide a trim method on d128.

@mispecto
Copy link
Author

mispecto commented Mar 9, 2021

Frankly, I don't know. decNumberTrim is a utility function as it's called internally, I'm not sure it should be part of the API. Anyway, I don't think this decision should be made as part of this PR.

@mispecto
Copy link
Author

@jonathanstrong is there a concern regarding usage of decNumberReduce()?

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