Does int128() and uint128() croak for "0400000000000000000000000000000000000000"?
It should now ;-)
Does $x + undef and the like warn?
yes
(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.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|