@@ -1445,7 +1445,7 @@ public static function DEVSQ(...$args)
1445
1445
return $ returnValue ;
1446
1446
}
1447
1447
1448
- return self ::NA ();
1448
+ return Functions ::NA ();
1449
1449
}
1450
1450
1451
1451
/**
@@ -1701,7 +1701,6 @@ public static function GAMMAINV($probability, $alpha, $beta)
1701
1701
$ xHi = $ alpha * $ beta * 5 ;
1702
1702
1703
1703
$ x = $ xNew = 1 ;
1704
- $ error = $ pdf = 0 ;
1705
1704
$ dx = 1024 ;
1706
1705
$ i = 0 ;
1707
1706
@@ -2019,11 +2018,12 @@ public static function KURT(...$args)
2019
2018
public static function LARGE (...$ args )
2020
2019
{
2021
2020
$ aArgs = Functions::flattenArray ($ args );
2022
-
2023
- // Calculate
2024
- $ entry = floor (array_pop ($ aArgs ));
2021
+ $ entry = array_pop ($ aArgs );
2025
2022
2026
2023
if ((is_numeric ($ entry )) && (!is_string ($ entry ))) {
2024
+ $ entry = (int ) floor ($ entry );
2025
+
2026
+ // Calculate
2027
2027
$ mArgs = [];
2028
2028
foreach ($ aArgs as $ arg ) {
2029
2029
// Is it a numeric value?
@@ -2032,7 +2032,7 @@ public static function LARGE(...$args)
2032
2032
}
2033
2033
}
2034
2034
$ count = self ::COUNT ($ mArgs );
2035
- $ entry = floor ( --$ entry) ;
2035
+ --$ entry ;
2036
2036
if (($ entry < 0 ) || ($ entry >= $ count ) || ($ count == 0 )) {
2037
2037
return Functions::NAN ();
2038
2038
}
@@ -2873,7 +2873,7 @@ public static function PERCENTILE(...$args)
2873
2873
* @param int $value the number whose rank you want to find
2874
2874
* @param int $significance the number of significant digits for the returned percentage value
2875
2875
*
2876
- * @return float
2876
+ * @return float|string (string if result is an error)
2877
2877
*/
2878
2878
public static function PERCENTRANK ($ valueSet , $ value , $ significance = 3 )
2879
2879
{
@@ -3169,6 +3169,8 @@ public static function SMALL(...$args)
3169
3169
$ entry = array_pop ($ aArgs );
3170
3170
3171
3171
if ((is_numeric ($ entry )) && (!is_string ($ entry ))) {
3172
+ $ entry = (int ) floor ($ entry );
3173
+
3172
3174
$ mArgs = [];
3173
3175
foreach ($ aArgs as $ arg ) {
3174
3176
// Is it a numeric value?
@@ -3177,7 +3179,7 @@ public static function SMALL(...$args)
3177
3179
}
3178
3180
}
3179
3181
$ count = self ::COUNT ($ mArgs );
3180
- $ entry = floor ( --$ entry) ;
3182
+ --$ entry ;
3181
3183
if (($ entry < 0 ) || ($ entry >= $ count ) || ($ count == 0 )) {
3182
3184
return Functions::NAN ();
3183
3185
}
@@ -3481,7 +3483,6 @@ public static function TDIST($value, $degrees, $tails)
3481
3483
$ ttheta = atan2 ($ value , sqrt ($ tterm ));
3482
3484
$ tc = cos ($ ttheta );
3483
3485
$ ts = sin ($ ttheta );
3484
- $ tsum = 0 ;
3485
3486
3486
3487
if (($ degrees % 2 ) == 1 ) {
3487
3488
$ ti = 3 ;
@@ -3657,7 +3658,7 @@ public static function TRIMMEAN(...$args)
3657
3658
*
3658
3659
* @param mixed ...$args Data values
3659
3660
*
3660
- * @return float
3661
+ * @return float|string (string if result is an error)
3661
3662
*/
3662
3663
public static function VARFunc (...$ args )
3663
3664
{
@@ -3699,7 +3700,7 @@ public static function VARFunc(...$args)
3699
3700
*
3700
3701
* @param mixed ...$args Data values
3701
3702
*
3702
- * @return float
3703
+ * @return float|string (string if result is an error)
3703
3704
*/
3704
3705
public static function VARA (...$ args )
3705
3706
{
@@ -3754,7 +3755,7 @@ public static function VARA(...$args)
3754
3755
*
3755
3756
* @param mixed ...$args Data values
3756
3757
*
3757
- * @return float
3758
+ * @return float|string (string if result is an error)
3758
3759
*/
3759
3760
public static function VARP (...$ args )
3760
3761
{
@@ -3797,7 +3798,7 @@ public static function VARP(...$args)
3797
3798
*
3798
3799
* @param mixed ...$args Data values
3799
3800
*
3800
- * @return float
3801
+ * @return float|string (string if result is an error)
3801
3802
*/
3802
3803
public static function VARPA (...$ args )
3803
3804
{
@@ -3853,7 +3854,7 @@ public static function VARPA(...$args)
3853
3854
* @param float $beta Beta Parameter
3854
3855
* @param bool $cumulative
3855
3856
*
3856
- * @return float
3857
+ * @return float|string (string if result is an error)
3857
3858
*/
3858
3859
public static function WEIBULL ($ value , $ alpha , $ beta , $ cumulative )
3859
3860
{
@@ -3887,7 +3888,7 @@ public static function WEIBULL($value, $alpha, $beta, $cumulative)
3887
3888
* @param float $m0 Alpha Parameter
3888
3889
* @param float $sigma Beta Parameter
3889
3890
*
3890
- * @return float|string
3891
+ * @return float|string (string if result is an error)
3891
3892
*/
3892
3893
public static function ZTEST ($ dataSet , $ m0 , $ sigma = null )
3893
3894
{
0 commit comments