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/ ......
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¶¯Ì¬´¦ÀíÈ»ºóÊä³ö,Ò»°ãÓÃÓÚ±äÁ¿.
±äÁ¿ÐÎ̬:
Ò»ÖÖÊÇTrue ¼´ ÕæµÄ;
ÁíÒ»ÖÖÊÇFalse ¼´¼ÙµÄ
³£¼û±äÁ¿ÐÎ̬:
string ×Ö´®(Êý×Ö\ºº×Ö\µÈµÈ)
integer ÕûÊý(1¡¢2¡¢3¡¢4¡¢5¡¢0¡¢-1¡¢-2¡¢µÈµ ......
PHP
ÊÇÎÒÓùýµÄÓïÑÔÖУ¬×îÁîÈËÄÕ»ðµÄµ«Í¬Ê±Ò²ÊÇ×îÓÐȤµÄÓïÑÔ¡£ÎÒÖ®ËùÒÔ˵“ÁîÈËÄÕ»ð”Ö÷ÒªÊÇÒòΪº¯ÊýÃüÃû¼«Æä²»Ò»Ö¡£¾¡¹ÜÎÒÿÌì¶¼ÒªÓõ½ÕâЩº¯Êý£¬ÎÒ»¹ÊÇÒªÏë
һϓ¾¿¾¹ÊÇ str_pos »¹ÊÇ strpos£¿ÊÇ str_split »¹ÊÇ
strsplit£¿”¡£ÁíÒ»·½Ã棬ÓÐʱºò¿ÉÒÔÓÃÒ»Ðмòµ¥µÄ´úÂë¾ÍÄܽâ¾öÒ»¸öÄÑÌâ¡£
ÏÂÃæ ......
PHPÓïÑÔ±¾ÉíÊDz»Ö§³Ö¶àÏ̵߳Ä. ×ܽáÁËÒ»ÏÂÍøÉϹØÓÚPHPÄ£Äâ¶àÏ̵߳ķ½·¨, ×ܵÄÀ´Ëµ, ¶¼ÊÇÀûÓÃÁËPHPµÄºÃ»ï°éÃDZ¾ÉíËù¾ßÓеĶàÏß³ÌÄÜÁ¦.
PHPµÄºÃ»ï°éÖ¸µÄ¾ÍÊÇLINUXºÍAPACHEÀ², LAMPÂï.
ÁíÍâ, ¼ÈÈ»ÊÇÄ£ÄâµÄ, ¾Í²»ÊÇÕæÕýµÄ¶àÏß³Ì. ÆäʵֻÊÇ¶à½ø³Ì. ½ø³ÌºÍÏß³ÌÊÇÁ½¸ö²»Í¬µÄ¸ÅÄî. ºÃÁË, ÒÔÏ·½·¨¶¼ÊÇ´ÓÍøÉÏÕÒÀ´µÄ.
1. ÀûÓÃLIN ......