当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPExcel_Calculation_Functions::null方法代码示例

本文整理汇总了PHP中PHPExcel_Calculation_Functions::null方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPExcel_Calculation_Functions::null方法的具体用法?PHP PHPExcel_Calculation_Functions::null怎么用?PHP PHPExcel_Calculation_Functions::null使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPExcel_Calculation_Functions的用法示例。


在下文中一共展示了PHPExcel_Calculation_Functions::null方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _inverse_ncdf

 private static function _inverse_ncdf($p)
 {
     //	Inverse ncdf approximation by Peter J. Acklam, implementation adapted to
     //	PHP by Michael Nickerson, using Dr. Thomas Ziegler's C implementation as
     //	a guide. http://home.online.no/~pjacklam/notes/invnorm/index.html
     //	I have not checked the accuracy of this implementation. Be aware that PHP
     //	will truncate the coeficcients to 14 digits.
     //	You have permission to use and distribute this function freely for
     //	whatever purpose you want, but please show common courtesy and give credit
     //	where credit is due.
     //	Input paramater is $p - probability - where 0 < p < 1.
     //	Coefficients in rational approximations
     static $a = array(1 => -39.69683028665376, 2 => 220.9460984245205, 3 => -275.9285104469687, 4 => 138.357751867269, 5 => -30.66479806614716, 6 => 2.506628277459239);
     static $b = array(1 => -54.47609879822406, 2 => 161.5858368580409, 3 => -155.6989798598866, 4 => 66.80131188771972, 5 => -13.28068155288572);
     static $c = array(1 => -0.007784894002430293, 2 => -0.3223964580411365, 3 => -2.400758277161838, 4 => -2.549732539343734, 5 => 4.374664141464968, 6 => 2.938163982698783);
     static $d = array(1 => 0.007784695709041462, 2 => 0.3224671290700398, 3 => 2.445134137142996, 4 => 3.754408661907416);
     //	Define lower and upper region break-points.
     $p_low = 0.02425;
     // Use lower region approx. below this
     $p_high = 1 - $p_low;
     // Use upper region approx. above this
     if (0 < $p && $p < $p_low) {
         //	Rational approximation for lower region.
         $q = sqrt(-2 * log($p));
         return ((((($c[1] * $q + $c[2]) * $q + $c[3]) * $q + $c[4]) * $q + $c[5]) * $q + $c[6]) / (((($d[1] * $q + $d[2]) * $q + $d[3]) * $q + $d[4]) * $q + 1);
     } elseif ($p_low <= $p && $p <= $p_high) {
         //	Rational approximation for central region.
         $q = $p - 0.5;
         $r = $q * $q;
         return ((((($a[1] * $r + $a[2]) * $r + $a[3]) * $r + $a[4]) * $r + $a[5]) * $r + $a[6]) * $q / ((((($b[1] * $r + $b[2]) * $r + $b[3]) * $r + $b[4]) * $r + $b[5]) * $r + 1);
     } elseif ($p_high < $p && $p < 1) {
         //	Rational approximation for upper region.
         $q = sqrt(-2 * log(1 - $p));
         return -((((($c[1] * $q + $c[2]) * $q + $c[3]) * $q + $c[4]) * $q + $c[5]) * $q + $c[6]) / (((($d[1] * $q + $d[2]) * $q + $d[3]) * $q + $d[4]) * $q + 1);
     }
     //	If 0 < p < 1, return a null value
     return PHPExcel_Calculation_Functions::null();
 }
开发者ID:ahmatjan,项目名称:OpenCart-Overclocked,代码行数:38,代码来源:Statistical.php

示例2: testNULL

 public function testNULL()
 {
     $result = PHPExcel_Calculation_Functions::null();
     $this->assertEquals('#NULL!', $result);
 }
开发者ID:iwillhappy1314,项目名称:laravel-admin,代码行数:5,代码来源:FunctionsTest.php


注:本文中的PHPExcel_Calculation_Functions::null方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。