Ensuring large number precision and avoiding float.
Recently in part of my code I've noticed a strange occurance when working with large numbers (greater than the 32-bit range).
What I'd like to know is if anyone knows of a way to ensure that a large integer say "12476476550" for example remains as an int and doesn't get converted to a float.
What's happening is part-way during the code (and strangest of all) when performing a subtraction the number is converting to a float and a small 'decimal' is added despite both numbers in the subtraction being actual whole numbers.
The only thing I can put this down to is a change in the actual data type perl is thinking the variable is and when converting to a float it's loosing precision.
This is an example of the issue:
Input Number: 15892213505
Returns a result like: 3007311616.99999
I've already tried Math::BigInt and use bigint; but both have serious performance impacts which means these aren't able to be used.
Any suggestions welcome.