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

Bugs in number to string conversion #254

Open
hns opened this issue Nov 14, 2015 · 5 comments
Open

Bugs in number to string conversion #254

hns opened this issue Nov 14, 2015 · 5 comments
Labels
bug Issues considered a bug Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec good first issue Great place to start if you're looking to start an open source "resume"

Comments

@hns
Copy link
Contributor

hns commented Nov 14, 2015

I recently ported the V8 double-conversion package to Java for Nashorn. I've done this previously for Rhino, the code is in the v8dtoa package. Since I did the Rhino port, the code has been pulled into a standalone library and greatly enhanced. There's now code for all three kinds of conversion (shortest, fixed, precision) as well as a Bignum-based fallback implementation, and most of all there's a very good test suite (which may have existed before, but probably as part of the greater V8 test suite).

During the Nashorn port I realized that there probably are some bugs in the Rhino port, mostly subtle ones related to signed operations on longs/ints that should be treated as unsigned. In Nashorn I made use of the new unsigned Long/Integer arithmetic API in JDK8, which is probably not an option for Rhino. Still, the Nashorn code and test suite can probably help in spotting the these issues.

http://hg.openjdk.java.net/jdk9/dev/nashorn/file/53edf7f3f10c/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/doubleconv
http://hg.openjdk.java.net/jdk9/dev/nashorn/file/53edf7f3f10c/test/src/jdk/nashorn/internal/runtime/doubleconv/test

I'd be happy to help getting this fixed in Rhino. I don't have the time to do it right now. I hope I'll find some time for it soon, and of course I'd also be happy to assist anybody else willing to tackle it. A good first step would be to run FastDtoaTest against the FastDtoa.java class in Rhino.

@gbrail
Copy link
Collaborator

gbrail commented Nov 16, 2015

Of course it'd be great if you had time to work on that, but we have a few
people working on the project who might pick this up. So thanks for
entering it!

On Sat, Nov 14, 2015 at 12:21 AM, Hannes Wallnöfer <[email protected]

wrote:

I recently ported the V8 double-conversion package to Java for Nashorn.
I've done this previously for Rhino, the code is in
org/mozilla/javascript/v8dtoa. Since I did the Rhino port, the code has
been pulled into a standalone library and greatly enhanced. There's now
code for all three kinds of conversion (shortest, fixed, precision) as well
as a Bignum-based fallback implementation, and most of all there's a very
good test suite (which may have existed before, but probably as part of the
greater V8 test suite).

During the Nashorn port I realized that there probably are some bugs in
the Rhino port, mostly subtle ones related to signed operations on
longs/ints that should be treated as unsigned. In Nashorn I made use of the
new unsigned Long/Integer arithmetic API in JDK8, which is probably not an
option for Rhino. Still, the Nashorn code and test suite can probably help
in spotting the these issues.

http://hg.openjdk.java.net/jdk9/dev/nashorn/file/53edf7f3f10c/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/doubleconv

http://hg.openjdk.java.net/jdk9/dev/nashorn/file/53edf7f3f10c/test/src/jdk/nashorn/internal/runtime/doubleconv/test

I'd be happy to help getting this fixed in Rhino. I don't have the time to
do it right now. I hope I'll find some time for it soon, and of course I'd
also be happy to assist anybody else willing to tackle it.


Reply to this email directly or view it on GitHub
#254.

Greg Brail | apigee https://apigee.com/ | twitter @gbrail
http://twitter.com/gbrail @apigee https://twitter.com/apigee

@chimbs86
Copy link

chimbs86 commented Feb 1, 2016

is anyone looking at this? I havent worked on rhino before, and it looks like an easy first task. Please advise

@gbrail
Copy link
Collaborator

gbrail commented Feb 2, 2016

Hannes was going to port some code from Nashorn but I don't think he has
time. So that means that if you'd like to work on it, then you can go
ahead. If you post updates in the GitHub issue from time to time then it'd
help in case you get stuck and don't get to finish it.

On Mon, Feb 1, 2016 at 2:00 PM, Gaurav [email protected] wrote:

is anyone looking at this? I havent worked on rhino before, and it looks
like an easy first task. Please advise


Reply to this email directly or view it on GitHub
#254 (comment).

Greg Brail | apigee https://apigee.com/ | twitter @gbrail
http://twitter.com/gbrail @apigee https://twitter.com/apigee

@p-bakker p-bakker added bug Issues considered a bug good first issue Great place to start if you're looking to start an open source "resume" labels Jul 6, 2021
@p-bakker p-bakker added the Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec label Aug 23, 2024
@Mindslayer001
Copy link

Dear Guys,

I would appreciate the opportunity to work on these tasks. Could someone kindly provide me with a hint or guidance regarding the location of the error code?

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues considered a bug Ecma Incompatibility Issues about Rhino being incompatible with the EcmaScript spec good first issue Great place to start if you're looking to start an open source "resume"
Projects
None yet
Development

No branches or pull requests

6 participants