Does int128() and uint128() croak for "0400000000000000000000000000000000000000"?
It should now ;-)
Does $x + undef and the like warn?
(Note that «undef + $x» cannot warn without making «my $x; $x += int128(...)» warn.)
Operations with undefs always generate warnings. Emulating the Perl behavior for built-ins up to this level is not one of my targets.
Does signed to unsigned promotion occur when required? (e.g. when adding two a large number overflows.)
Does unsigned to signed promotion occur when required? (e.g. when subtraction overflows to something negative.)
No, automatic promotions would just complicate the semantics of the module too much.
Currently, the module provides modulo 2**128 signed and unsigned arithmetic and the semantics are pretty simple:
Are the string buffers always suitably aligned for a int128_t? (You use memcpy in some spots, but casts in others.)
Internally 128bit values are stored on the stack or on the PV slot of an SV allocated with newSV(16). As GCC seems to use 64bit instructions to load 128 bits integers from memory, alignment should be right.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||