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

provide ::new methods accepting i64/u64 and maybe floating values #25

Open
fulara opened this issue Feb 23, 2017 · 2 comments
Open

provide ::new methods accepting i64/u64 and maybe floating values #25

fulara opened this issue Feb 23, 2017 · 2 comments

Comments

@fulara
Copy link
Contributor

fulara commented Feb 23, 2017

Currenty only two methods new() are present, from i32 and u32.
Is there any reason why?
It should be psosible to provide more overloads? for f64 and at least for i64.

@alkis
Copy link
Owner

alkis commented Mar 4, 2017

I think for int64/f64 we will need to convert them into BCD8 and call decQuadFromBCD. int64 should be exact, f64 will be lossy. Do you want to take a stab at it?

@fulara
Copy link
Contributor Author

fulara commented Mar 5, 2017

Yep. I will work on this.
I've attached pull request which has work on the i64/u64.
I had to implement the double dabble algorithm - well i copied the impl from wikipedia. I did not find one available here.

Please comment whether this looks good for you. if it does i will work on adding fp support. Do you have some ideas as to how to convert from fp to dec?

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

No branches or pull requests

2 participants