mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-24 12:08:36 +00:00
5eb46bd48e
Fix #4167. That problem was initially reported as a problem with TINV, however, at its root, it was actually a problem with TDIST (which TINV needs to call). Both of these are deprecated by Microsoft in favor of some newer functions. PhpSpreadsheet incorrectly treated T.INV as an alias for TINV, and did not implement T.INV.2T, which actually is an alias for TINV. To solve this problem, I adapted the Perl CPAN module `Statistics::Disttributions`, written by Michael Kospach around 2003. Unit test results have been manually checked against Excel; a few had to be changed because they were wrong (see the original issue). I believe that all of TDIST, T.DIST.2T, T.DIST.RT, TINV, T.INV, and T.INV.2T now function correctly, at least most of the time. I have not found code or an algorithm that I can use for T.DIST nor for T.TEST, both of which remain unimplemented.
43 lines
581 B
PHP
43 lines
581 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
return [
|
|
[
|
|
0.027322464988,
|
|
1.959999998, 60,
|
|
],
|
|
[
|
|
0.170446566151,
|
|
1, 10,
|
|
],
|
|
[
|
|
0.028237990213,
|
|
2, 25,
|
|
],
|
|
'test 1 derived from Perl suite 1-tail' => [
|
|
0.0041301,
|
|
6.251, 3,
|
|
],
|
|
'issue 4167' => [
|
|
0.15865168744175628,
|
|
1.8373862310371, 1,
|
|
],
|
|
[
|
|
'#VALUE!',
|
|
'NaN', 10,
|
|
],
|
|
[
|
|
'#VALUE!',
|
|
1, 'NaN',
|
|
],
|
|
[
|
|
'#NUM!',
|
|
-1, 10,
|
|
],
|
|
[
|
|
'#NUM!',
|
|
1, 0,
|
|
],
|
|
];
|