I need to store a huge number in a PHP variable (it’s for a programming contest if you’re wondering why). However, if the number is too big, it gets displayed as 6.2995416979471E+77. Is there a way to store that huge number in PHP?
I need to store a huge number in a PHP variable (it’s for a
Share
integershave a limited size of 32 or 64bit, depending on your architecture.floatscan store values of any size, but are imprecise.If you want to work with giant, precise numbers, use strings and the BC Math extension.