in reply to Re: modulo 1 (%1) and fractional part of a number
in thread modulo 1 (%1) and fractional part of a number

It's understandable to have a different interpretation of the modulo operator: different languages implement it differently, and Perl's implementation is not the most straightforward. If you come from the spreadsheet world, Excel's MOD() and VBA's Mod both work with floating point. C's % works purely with integers, or fmod() for floating point. Perl's %, OTOH, has a bunch of conditionals to determine integer vs. floating-point context. I'll expound on them slightly, in case it might help JBCookin:

JBCookin, I hope this helps you understand better... And hippo's solution should give you the fractional component you need.

update: strike the invalid interpretation; thanks syphilis++ for confirmation of the alternate

Replies are listed 'Best First'.
Re^3: modulo 1 (%1) and fractional part of a number
by syphilis (Archbishop) on Sep 11, 2018 at 14:24 UTC
    ... but it might use perl -V:ivsize instead...

    Yes, "ivsize" is what you need to look at. That tells you how many bytes there are in the signed and unsigned perl integers (IV and UV).
    "intsize" merely tells you the number of bytes in the C "int" for the compiler that built perl, and that is commonly less than the number of bytes in the perl integer.

    Cheers,
    Rob