Why "use integer" makes no difference, IMO, is that Perl recognises the example expression as floating pointYes, I think it's likely that perl does precisely that ... but it's rather simplistic of perl to assume that the value should be represented as an NV (double) just because scientific notation was used. (Of course, on a 32-bit build of perl it won't matter, but on a 'use64bitint' build of perl it's not a very bright thing to do, imo - unless 'uselongdouble' is also in place as
ysth recommended - in which case it'll be ok).
As
tye suggested, I think there's an element of "history" here. (I referred to the same thing in one of my posts in this thread as "32-bit legacy".) No matter what you call it, I don't think it's a very convincing excuse.
tye also referred to "perl opcodes" - and, I must confess, that I have no idea how that impacts upon perl's capacity to get it right.
My hunch (and it's no more than that) is that there's a lack of interest in getting perl to do the right thing wrt 'use64bitint' builds ... and, furthermore, that's the main reason that perl doesn't do the right thing.
I mean, how hard would it be for perl to determine that
1.44115188075868217e17 represents an integer (especially with
use integer;), stick that value in an IV slot (given that it fits there), and turn on the IOK flag ? I don't know the answer to that question, btw ... but Shirley that wouldn't be all that difficult for the current perl pumpkings to implement. (As always, I stand to be corrected.)
Anyway, perl's one redeeming feature is that it at least gives one the tools to fix the problems it creates :-)
Cheers,
Rob