** is handled as a floating point operation using log and exp, and 64-bit FP doesn't have the mantissa precision for the 1 to add in. Use 1<<55 instead.

I found my problem. After carefully coding to work with 32 and 64 bit ints, I wrote lines like left_shift = 32 - right_shift; not once but 4 times!

ANSWER MY OWN Q: stuck "LLU" after the 0x8000000000000000 and all is well

Which brings me to a question that is REALLY off topic for Perlmonks, but if no one wants to answer it, maybe someone can suggest a place to ask the Q. For this example, UV and IV are 64 bits.
#define BIT_WITHIN_UV_MASK 0x3F #define BIT0 ((UV)0x8000000000000000) #define BITNO_TO_BITMASK(bitno) (BIT0>>(bitno&BIT_WITHIN_UV_MASK)) SV *mm_array_fetch (mm_array *array, IV index, int prelocked) { UV uv; uv = ... sv = uv & BITNO_TO_BITMASK(index) ? &PL_sv_yes : &PL_sv_no;
The last line gets the following warning from gcc:
MMA.xs:463: warning: integer constant is too large for "long" type
Thanks,
cmac

In reply to Re^2: Q about module building by cmac
in thread Q about module building by cmac

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.