• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






kurer风

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

2013年11月18日

PHP 浮点数
摘要: 浮点数的精度有限。尽管取决于系统,PHP 通常使用 IEEE 754 双精度格式,则由于取整而导致的最大相对误差为 1.11e-16。非基本数学运算可能会给出更大误差,并且要考虑到进行复合运算时的误差传递。此外,以十进制能够精确表示的有理数如 0.1 或 0.7,无论有多少尾数都不能被内部所使用的二进制精确表示,因此不能在不丢失一点点精度的情况下转换为二进制的格式。这就会造成混乱的结果:例如,floor((0.1+0.7)*10) 通常会返回 7 而不是预期中的 8,因为该结果内部的表示其实是类似 7.9999999999999991118...。所以永远不要相信浮点数结果精确到了最后一位,也 阅读全文
posted @ 2013-11-18 21:39 kurer风 阅读(195) 评论(0) 推荐(0)
 

2013年9月16日

设置HTTP Header
摘要: 1. Apache 中需要支持的模块LoadModule expires_module modules/mod_expires.soLoadModule file_cache_module modules/mod_file_cache.soLoadModule headers_module modules/mod_headers.so2.在站点目录下创建.htaccess文件添加如下过期时间的定义规则# Set up 2 Hour caching on commonly updated filesExpiresActive OnExpiresDefault A0ExpiresDefault A 阅读全文
posted @ 2013-09-16 14:46 kurer风 阅读(390) 评论(0) 推荐(0)
 
cache control - 摘录
摘要: Cache-Control HTTP HeadersAlthough the Expires header is useful, it's still somewhat limited; there are many situations where content is cacheable, but the HTTP/1.0 protocol lacks methods of telling caches what it is, or how to work with it. HTTP/1.1 introduces a new class of headers, theCache-C 阅读全文
posted @ 2013-09-16 13:52 kurer风 阅读(170) 评论(0) 推荐(0)