mirror of
https://github.com/php/doc-en.git
synced 2026-03-24 15:52:15 +01:00
317 lines
7.4 KiB
XML
317 lines
7.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<!-- $Revision$ -->
|
||
<appendix xml:id="math.constants" xmlns="http://docbook.org/ns/docbook">
|
||
&reftitle.constants;
|
||
&extension.constants.core;
|
||
<!-- TODO: Use MathML the moment PhD supports it -->
|
||
<variablelist>
|
||
<title>Mathematical Constants</title>
|
||
<varlistentry xml:id="constant.m-pi">
|
||
<term>
|
||
<constant>M_PI</constant>
|
||
(<type>float</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Approximation of the number π (pi).
|
||
(<literal>3.14159265358979323846</literal>).
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="constant.m-e">
|
||
<term>
|
||
<constant>M_E</constant>
|
||
(<type>float</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Approximation of Euler's number <literal>e</literal>
|
||
(<literal>2.7182818284590452354</literal>).
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="constant.m-log2e">
|
||
<term>
|
||
<constant>M_LOG2E</constant>
|
||
(<type>float</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Approximation of <literal>log<subscript>2</subscript>(e)</literal>
|
||
(<literal>1.4426950408889634074</literal>).
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="constant.m-log10e">
|
||
<term>
|
||
<constant>M_LOG10E</constant>
|
||
(<type>float</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Approximation of <literal>log<subscript>10</subscript>(e)</literal>
|
||
(<literal>0.43429448190325182765</literal>).
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="constant.m-ln2">
|
||
<term>
|
||
<constant>M_LN2</constant>
|
||
(<type>float</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Approximation of <literal>ln(2)</literal>
|
||
(<literal>0.69314718055994530942</literal>).
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="constant.m-ln10">
|
||
<term>
|
||
<constant>M_LN10</constant>
|
||
(<type>float</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Approximation of <literal>ln(10)</literal>
|
||
(<literal>2.30258509299404568402</literal>).
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="constant.m-pi-2">
|
||
<term>
|
||
<constant>M_PI_2</constant>
|
||
(<type>float</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Approximation of <literal>π/2</literal>
|
||
(<literal>1.57079632679489661923</literal>).
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="constant.m-pi-4">
|
||
<term>
|
||
<constant>M_PI_4</constant>
|
||
(<type>float</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Approximation of <literal>π/4</literal>
|
||
(<literal>0.78539816339744830962</literal>).
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="constant.m-1-pi">
|
||
<term>
|
||
<constant>M_1_PI</constant>
|
||
(<type>float</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Approximation of <literal>1/π</literal>
|
||
(<literal>0.31830988618379067154</literal>).
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="constant.m-2-pi">
|
||
<term>
|
||
<constant>M_2_PI</constant>
|
||
(<type>float</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Approximation of <literal>2/π</literal>
|
||
(<literal>0.63661977236758134308</literal>).
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="constant.m-sqrtpi">
|
||
<term>
|
||
<constant>M_SQRTPI</constant>
|
||
(<type>float</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Approximation of <literal>sqrt(π)</literal>
|
||
(<literal>1.77245385090551602729</literal>).
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="constant.m-2-sqrtpi">
|
||
<term>
|
||
<constant>M_2_SQRTPI</constant>
|
||
(<type>float</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Approximation of <literal>2/sqrt(π)</literal>
|
||
(<literal>1.12837916709551257390</literal>).
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="constant.m-sqrt2">
|
||
<term>
|
||
<constant>M_SQRT2</constant>
|
||
(<type>float</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Approximation of <literal>sqrt(2)</literal>
|
||
(<literal>1.41421356237309504880</literal>).
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="constant.m-sqrt3">
|
||
<term>
|
||
<constant>M_SQRT3</constant>
|
||
(<type>float</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Approximation of <literal>sqrt(3)</literal>
|
||
(<literal>1.73205080756887729352</literal>).
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="constant.m-sqrt1-2">
|
||
<term>
|
||
<constant>M_SQRT1_2</constant>
|
||
(<type>float</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Approximation of <literal>1/sqrt(2)</literal>
|
||
(<literal>0.70710678118654752440</literal>).
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="constant.m-lnpi">
|
||
<term>
|
||
<constant>M_LNPI</constant>
|
||
(<type>float</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Approximation of <literal>ln(π)</literal>
|
||
(<literal>1.14472988584940017414</literal>).
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="constant.m-euler">
|
||
<term>
|
||
<constant>M_EULER</constant>
|
||
(<type>float</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Approximation of Euler's constant γ
|
||
(<literal>0.57721566490153286061</literal>).
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
</variablelist>
|
||
|
||
<variablelist>
|
||
<title>IEEE 754 floating point constants</title>
|
||
<varlistentry xml:id="constant.nan">
|
||
<term>
|
||
<constant>NAN</constant>
|
||
(<type>float</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Not A Number
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="constant.inf">
|
||
<term>
|
||
<constant>INF</constant>
|
||
(<type>float</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Infinity
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
</variablelist>
|
||
|
||
<variablelist>
|
||
<title>Rounding constants</title>
|
||
<note>
|
||
<simpara>
|
||
As of PHP 8.4.0, it is recommended to use the
|
||
<!-- <enumname>RoundingMode</enumname> -->
|
||
RoundingMode
|
||
enum instead.
|
||
</simpara>
|
||
</note>
|
||
<varlistentry xml:id="constant.php-round-half-up">
|
||
<term>
|
||
<constant>PHP_ROUND_HALF_UP</constant>
|
||
(<type>int</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Rounding half away from zero.
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="constant.php-round-half-down">
|
||
<term>
|
||
<constant>PHP_ROUND_HALF_DOWN</constant>
|
||
(<type>int</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Rounding half toward zero.
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="constant.php-round-half-even">
|
||
<term>
|
||
<constant>PHP_ROUND_HALF_EVEN</constant>
|
||
(<type>int</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Round halves to even numbers
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry xml:id="constant.php-round-half-odd">
|
||
<term>
|
||
<constant>PHP_ROUND_HALF_ODD</constant>
|
||
(<type>int</type>)
|
||
</term>
|
||
<listitem>
|
||
<simpara>
|
||
Round halves to odd numbers
|
||
</simpara>
|
||
</listitem>
|
||
</varlistentry>
|
||
</variablelist>
|
||
</appendix>
|
||
<!-- Keep this comment at the end of the file
|
||
Local variables:
|
||
mode: sgml
|
||
sgml-omittag:t
|
||
sgml-shorttag:t
|
||
sgml-minimize-attributes:nil
|
||
sgml-always-quote-attributes:t
|
||
sgml-indent-step:1
|
||
sgml-indent-data:t
|
||
indent-tabs-mode:nil
|
||
sgml-parent-document:nil
|
||
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
||
sgml-exposed-tags:nil
|
||
sgml-local-catalogs:nil
|
||
sgml-local-ecat-files:nil
|
||
End:
|
||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||
vim: et tw=78 syn=sgml
|
||
vi: ts=1 sw=1
|
||
-->
|