-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lua, PHP: avoid conversion of "unsigned" 64-bit int literals to float
PHP and Lua only have *signed* 64-bit integers, so a decimal literal greater than the maximum signed 64-bit integer (`2**63 - 1`) will be interpreted as float. This is usually unacceptable, because it loses precision. If we output integers `2**63 <= x <= 2**64 - 1` so that they are interpreted as signed integers, we lose the information that they were unsigned, but at least we don't lose any significant bits. This approach is consistent with how integer reading methods in runtime libraries work - read unsigned 64-bit ints as signed values if the language doesn't support the unsigned.
- Loading branch information
1 parent
5cadb04
commit fd7f308
Showing
3 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters