… that PHP floats are in fact doubles, i.e. double-precision 64-bit numbers. They have 52 bits for mantissa, and integer values up to… s2=1125899906842625 As you can see float to string conversion is not portable across systems and PHP versions. So if you’re handling… compiled-in and php.ini-dist values seem to vary across architectures and versions, but setting precision=16 (enough to hold 2^53 in…
Comment: PHP vs. BIGINT vs. float conversion caveat
… strings there. Peter just made a typo. I explicitly mentioned conversion TO string, in bold. > in both cases float is expected to lose its precision No, it’s not. It must not lose precision in THIS case. Refer to IEEE 754 section on 64-bit doubles (it’s a bit more trusted source than php.net…

