Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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.


Ïà¹ØÎĵµ£º

php ÕÐÆ¸ÒªÇó ×ªÔØ

1. ¼ÆËã»úÏà¹Ø×¨Òµ±¾¿Æ¼°ÒÔÉÏѧÀú£¬2ÄêÒÔÉÏÏà¹Ø¹¤×÷¾­Ñé
2. ¾«Í¨PHP+Mysql¡¢AjaxµÈÏà¹Ø¿ª·¢
3. ¾«Í¨Javascript¡¢Html¡¢CSSµÈǰ¶Ë¼¼Êõ£¬²¢ÄÜÊìÁ·Ê¹ÓÃPrototype¡¢jQueryµÈ¿ªÔ´¿ò¼Ü
4. ¾«Í¨Mysql¡¢SqlServerµÈÊý¾Ý¿â
5. ÊìϤMVCģʽ¿ª·¢
6. ÊìϤWINDOWS¡¢LINUX¡¢UNIXµÈ²Ù×÷ϵͳ
7. ÊìϤApache¡¢IIS¡¢ZENDµÈÓ¦ÓÃ
3 ......

ʵÏÖPHP·ÃÎÊMYSQLÊý¾Ý¿âµÄÀà

PHPµÄÒ»¸öÊý¾Ý¿â²Ù×÷Àà,ÒÔUTF8¸ñʽдÈë,Êý¾Ý¿âÄÚÖ±½ÓÏÔʾÕý³£ÖÐÎÄ,·ÀÖ¹²éѯ³ö´í
/**
* @author xggxnn
* ±¾ÀàÓÃÓÚʵÏÖÓйØÊý¾Ý¿âµÄ·ÃÎÊ
*
*/
class DBConnection {
private $host = "";
private $user = "";
private $pass = "";
private $DBname = "";
public $isConnected = false;
/**
* ¹¹Ôìº ......

PHPÖлù±¾·ûºÅ¼°Ê¹Ó÷½·¨

// µ¥ÐÐ×¢½â
/* */ ¶àÐÐ×¢½â
ÒýºÅµÄʹÓÃ
’ ’ µ¥ÒýºÅ,ûÓÐÈκÎÒâÒå,²»¾­Èκδ¦ÀíÖ±½ÓÄùýÀ´;
" "Ë«ÒýºÅ,php¶¯Ì¬´¦ÀíÈ»ºóÊä³ö,Ò»°ãÓÃÓÚ±äÁ¿. 
±äÁ¿ÐÎ̬:
Ò»ÖÖÊÇTrue ¼´ ÕæµÄ;
ÁíÒ»ÖÖÊÇFalse ¼´¼ÙµÄ
³£¼û±äÁ¿ÐÎ̬:
string ×Ö´®(Êý×Ö\ºº×Ö\µÈµÈ)
integer ÕûÊý(1¡¢2¡¢3¡¢4¡¢5¡¢0¡¢-1¡¢-2¡¢µÈµ ......

ÓÃPHP×ö¸öÈ˲ÅÕ¾

  ×î½üÓÐÈËÔÚÕбêÒª×ö¸öÏñ£ºwww.webjianzhi.com ÕâÑùµÄÈ˲ÅÕ¾£¬³õ¿´£¬Õâ¸öÍøÂç¼æÖ°Íø£¬½çÃæ»¹ÊDZȽÏÇåÎúµÄ¡£
 ÕûÌå·ÖÎöÁËһϣ¬Ò»¸öÐÂÎÅÎÄÕ·¢²¼ÏµÍ³£¬Õâ¸ö²»ÊǺÜÄÑ£¬ÁíÒ»¸ö¾ÍÊÇ×ֶε÷ÓÃϵͳ£¬¾ÍÊÇÊ×Ò³µÄÖ°Òµ½éÉÜ£¬¼æÖ°ÈËÆø£¬µÄÕâЩµ÷Óá£
 ÁíÒ»¸ö¾ÍÊÇ»áÔ±·¢²¼ÏµÍ³¡£
  Õû¸öÓñí¸ñ²¼¾Ö£¬ÃÀ¹¤Éϲ»´æÔ ......

GyPSii API PHPÓ¦Óóõ̽

GyPSiiÀûÓÃXML-RPC£¬PHPÀïXML-RPCµÄÏà¹ØÓ¦ÓÃʾÀýºÜ¶à£¬²é²éÊֲᡢGOOGLEһϾͿÉÒÔÕÒµ½ºÜ¶à¡£GyPSii APIÀïÌṩÁËÒ»¸ö²Ù×÷ÀàÓÃÀ´ÇëÇó·þÎñ£¬²¢ÌṩÁËÒ»¸öÇëÇóº¯Êý£¬Ö»Òª½«´Ëº¯Êý·Å½ø²Ù×÷ÀàÀ¾Í¿ÉÒÔ·½±ãµÄʹÓÃÁË£¬º¯ÊýÈçÏ£º
function GyPSiiXMLRPC( $uri, $host, $pid, $body="" ) {
$this->addHeader( 'Content-T ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ