惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Cisco Blogs
NISL@THU
NISL@THU
G
GRAHAM CLULEY
T
Threatpost
I
Intezer
D
Darknet – Hacking Tools, Hacker News & Cyber Security
P
Proofpoint News Feed
L
Lohrmann on Cybersecurity
Cisco Talos Blog
Cisco Talos Blog
P
Privacy & Cybersecurity Law Blog
Security Latest
Security Latest
P
Palo Alto Networks Blog
L
LINUX DO - 热门话题
Cyberwarzone
Cyberwarzone
AI
AI
Help Net Security
Help Net Security
Forbes - Security
Forbes - Security
T
The Exploit Database - CXSecurity.com
月光博客
月光博客
The GitHub Blog
The GitHub Blog
aimingoo的专栏
aimingoo的专栏
C
CERT Recently Published Vulnerability Notes
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
N
News and Events Feed by Topic
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Scott Helme
Scott Helme
A
About on SuperTechFans
N
Netflix TechBlog - Medium
TaoSecurity Blog
TaoSecurity Blog
V
V2EX
MongoDB | Blog
MongoDB | Blog
AWS News Blog
AWS News Blog
Google DeepMind News
Google DeepMind News
Google Online Security Blog
Google Online Security Blog
O
OpenAI News
Y
Y Combinator Blog
S
Securelist
GbyAI
GbyAI
D
Docker
SecWiki News
SecWiki News
The Hacker News
The Hacker News
有赞技术团队
有赞技术团队
T
Tenable Blog
WordPress大学
WordPress大学
S
SegmentFault 最新的问题
P
Privacy International News Feed
S
Security Affairs
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Hacker News - Newest:
Hacker News - Newest: "LLM"
H
Hackread – Cybersecurity News, Data Breaches, AI and More

博客园 - 涂文瀚

常用的前端调试工具 用户中心 - 博客园 SQL中动态进行行转列 SQL SERVER 表分区实施步奏 [记录]SQL SERVER 跨库操作小记 PHP常见面试问题 在WIN下搭建PHP的测试、开发环境 [转]三款免费的PHP加速器:APC eAccelerator XCache比较 Xdebug如何选择PHP版本 PHP Cookbook读书笔记 – 第01章字符串 PHP Cookbook读书笔记 – 第03章日期和时间 PHP Cookbook读书笔记 – 第04章数组 PHP Cookbook读书笔记 – 第06章函数 PHP Cookbook读书笔记 – 第07章类和对象 PHP Cookbook读书笔记 – 第08章web基础 设计模式之观察者模式 PHP Cookbook读书笔记 – 第09章表单 PHP Cookbook读书笔记 – 第11章Session和持久化 PHP Cookbook读书笔记 – 第12章XML
PHP Cookbook读书笔记 – 第02章数字
涂文瀚 · 2011-12-15 · via 博客园 - 涂文瀚

第二章主要介绍了PHP如何处理数字,包括了开发中经常使用的小数取舍、数字格式化、大数字处理,同时还用了不少章节介绍科学计算及高精度计算需要用到的函数
is_numeric() : 判断一个变量或值是否是合法的数字类型
abs() : 返回绝对值
round() : 四舍五入
ceil() : 取大
floor() : 取小

截图00
range() : 取一个范围内的数,返回一个数组。还可以取范围内的字符数组
mt_rand() : 随机数,可设置取值范围
exp() : 取对数(略过)
pow() :计算指数(略过)
number_format() : 数字格式化,可设置取小数点后的位数,小数点的表示,千分位的表示
setlocale() : 本地化设置,在后面有一个章节会专门介绍
money_format() : 货币格式化,需要本地化设置的支持
sin() : 三角函数之正弦
cos() : 三角函数之反弦
tan() : 三角函数之正切
deg2rad() : 角度转弧度
rad2deg() : 弧度转角度
BCMath() : 高精度计算的函数库
GMP() : 同上
big_int() : PEAR包里的高精度技术库
base_convert() : 2、8、10、16进制转换函数