Search code examples
phpfloating-pointdoubledecimaltilde

What is meaning of tilde(~) symbol mean in the context of this PHP documentation page?


Consider below statement from the PHP Manual and let me know the meaning of tilde(~) symbol used in this context.

The size of a float is platform-dependent, although a maximum of ~1.8e308 with a precision of roughly 14 decimal digits is a common value (the 64 bit IEEE format).

Also, let me know whether the meaning of tilde(~) symbol have the meaning of negation/not in other contexts of PHP language as in Mathematics(For example, ~A means "not A.")?

Can the tilde(~) symbol used in mathematical or logical expression is PHP? If yes provide me some relative working code example of the same. If not explain me the reason behind it?


Solution

  • Edit: I've submitted a patch to fix it to the PHP documentation and it got accepted, the new phrasing is "approximately 1.9e308".

    It means "approximately" in this context, even though the sentence is poorly phrased, due to the very ambiguousness you cite.

    There's no mathematical or programmatic meaning behind the symbol in this particular context, although as you said, in a program, ~ means the bitwise not operator.

    My guess is that it was written without thought of the other meanings of ~ preceding a number.