-
-
Notifications
You must be signed in to change notification settings - Fork 661
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
Std.parseInt() does not parse negative hex numbers on neko/cpp target #10545
Comments
Also:
results in:
but I think this might not be considered a bug because the documentation does not mention |
tobil4sk
added a commit
to tobil4sk/neko
that referenced
this issue
Apr 2, 2022
All whitespace, along with + and - signs are allowed with hexadecimal notation, to match other haxe targets. See HaxeFoundation/haxe#10544 and HaxeFoundation/haxe#10545
This was referenced Apr 2, 2022
Simn
pushed a commit
to HaxeFoundation/neko
that referenced
this issue
Apr 11, 2022
* Fix builtin_int to handle space, +, and - with hex All whitespace, along with + and - signs are allowed with hexadecimal notation, to match other haxe targets. See HaxeFoundation/haxe#10544 and HaxeFoundation/haxe#10545 * Allow trailing text after hex in builtin_int() HaxeFoundation/haxe#7028
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://api.haxe.org/Std.html#parseInt says:
"x may also start with a - to denote a negative value."
I'm not sure if this refers to decimal format only or it applies to hex too, so I'm not sure if this is a bug or just the documentation being a bit vague.
The reason why I have doubts is because this code:
produces these results on following targets:
I'm running unit tests on
eval
target, and from time to time onneko
, and thought (based on the API docs)-0xa0
is a valid value, but it looks likeneko
andcpp
disagree. Maybe it's the case with some of the other targets (flash, c#, php, etc.) these are the only ones I tried.The text was updated successfully, but these errors were encountered: