PHP Floating point precision
Floating point precision
It is typical that simple decimal fractions like 0.1
or
0.7
cannot be converted into their internal binary
counterparts without a small loss of precision. This can lead to
confusing
results: for example, floor((0.1+0.7)*10)
will usually
return 7
instead of the expected 8
,
since the internal representation will be something like
7.9
.
This is due to the fact that it is impossible to express some
fractions in decimal notation with a finite number of digits. For
instance,
1/3
in decimal form becomes
0.3
.
So never trust floating number results to the last digit, and never
compare
floating point numbers for equality. If higher precision is
necessary,
the arbitrary
precision math functions
and
gmp
functions are available.
相关文档:
http://hi.baidu.com/fish124423/blog/item/c6f9f310190dd779ca80c456.html解决error trying access httpd. conf file.you will need to manually configure the的配置问题
Apache+mysql+php在windows下的配置(成功)
2008-12-16 14:49
Apche下载地点:http://www.apache/org
Or http://www.51cto.com/html/ ......
<?php
$p=new ReflectionClass(类对象);
$constants=$p->getConstants();//const 定义常量
$properties=$p->getProperties();//所有变量属性
$methods=$p->getMethods();//所有方法
//全部以数组形势返回
?> ......
看到同学们有不少在用php开发项目的,或许下面的资料对大家有用吧,用来学习一下也好。
收集的资料相关地址:
cubi demo site:http://dev.openbiz.cn/cubi/user/login
openBiz app cubi:http://docs.google.com/View?id=df5ktjv9_64f9fd88gf
openbiz architecture overview:
http: ......
GyPSii利用XML-RPC,PHP里XML-RPC的相关应用示例很多,查查手册、GOOGLE一下就可以找到很多。GyPSii API里提供了一个操作类用来请求服务,并提供了一个请求函数,只要将此函数放进操作类里,就可以方便的使用了,函数如下:
function GyPSiiXMLRPC( $uri, $host, $pid, $body="" ) {
$this->addHeader( 'Content-T ......
PHP语言本身是不支持多线程的. 总结了一下网上关于PHP模拟多线程的方法, 总的来说, 都是利用了PHP的好伙伴们本身所具有的多线程能力.
PHP的好伙伴指的就是LINUX和APACHE啦, LAMP嘛.
另外, 既然是模拟的, 就不是真正的多线程. 其实只是多进程. 进程和线程是两个不同的概念. 好了, 以下方法都是从网上找来的.
1. 利用LIN ......