2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2007-06-20 22:25:43 +00:00
|
|
|
<!-- $Revision: 1.9 $ -->
|
|
|
|
<refentry xml:id="function.pi" xmlns="http://docbook.org/ns/docbook">
|
2007-03-31 10:43:52 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>pi</refname>
|
|
|
|
<refpurpose>Get value of pi</refpurpose>
|
|
|
|
</refnamediv>
|
2007-03-31 11:20:55 +00:00
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2007-03-31 10:43:52 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>float</type><methodname>pi</methodname>
|
|
|
|
<void/>
|
|
|
|
</methodsynopsis>
|
|
|
|
<simpara>
|
|
|
|
Returns an approximation of pi. The returned <type>float</type>
|
|
|
|
has a precision based on the
|
|
|
|
<link linkend="ini.precision">precision</link> directive in
|
|
|
|
&php.ini;, which defaults to <literal>14</literal>.
|
|
|
|
Also, you can use the <constant>M_PI</constant> constant which yields
|
|
|
|
identical results to <function>pi</function>.
|
|
|
|
</simpara>
|
2007-03-31 19:18:23 +00:00
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
|
|
|
The value of pi as float.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
2007-03-31 10:43:52 +00:00
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title><function>pi</function> example</title>
|
|
|
|
<programlisting role="php">
|
2002-04-15 00:12:54 +00:00
|
|
|
<![CDATA[
|
2003-06-16 18:31:33 +00:00
|
|
|
<?php
|
2002-04-15 00:12:54 +00:00
|
|
|
echo pi(); // 3.1415926535898
|
|
|
|
echo M_PI; // 3.1415926535898
|
2003-06-16 18:31:33 +00:00
|
|
|
?>
|
2002-04-15 00:12:54 +00:00
|
|
|
]]>
|
2007-03-31 10:43:52 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
2002-04-15 00:12:54 +00:00
|
|
|
|
|
|
|
<!-- 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:"../../../../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
|
|
|
|
-->
|