just read the manual.
val() works on integer value and those have limits.

easiest way around is to use double values.
so, instead of:
$sixteen = 9876543210987654

use:
$sixteen = 9876543210987654.0
_________________________
!

download KiXnet