How to define pi in php

(*-*)浩
Release: 2023-02-23 18:50:02
Original
3243 people have browsed it

How to define pi in php

PHP pi() function

Definition and usage

pi()The function returns the value of pi.

Grammar(Recommended learning:PHP programming from entry to proficiency)

pi()
Copy after login

Instructions

Returns the approximate value of pi. The float precision of the return value is determined by the precision directive in php.ini. The default value is 14. You can also use the M_PI constant, which produces exactly the same result as pi().

Example

Copy after login

Output similar to:

3.14159265359
Copy after login

The above is the detailed content of How to define pi in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!