[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

SvIV upgrade to 64 bit int?



In patching Time::Local to be able to handle the new, expanded localtime(), it
had to deal with time values beyond 32 bits.  Time::Local used integer, which
meant none of its scalars could store anything beyond 32 bits.  So I had to
remove it.

Which got me thinking, the usual integer scalar upgrade path is IV -> UV ->
NV.  signed int -> unsigned int -> double.  Why not make use of 64 bit
integers in that upgrade path?  We already probe for them (quadtype).  If
we've got them, use them.

So make the upgrade path signed int -> unsigned int -> long long -> double.
That should make large integer operations faster and more accurate.

This also makes the "do you want to use 64 bit ints" question moot.  Perl uses
them when it needs them, just like it uses a double when it needs it.

Of course, I'm blithely ignoring the difficulties in making a new SV type.
But I'm curious if there's any objection other than the amount of coding
necessary and XS backwards compatibility.


-- 
THIS I COMMAND!


Follow-Ups from:
Joshua Hoblitt <jhoblitt@ifa.hawaii.edu>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]