Files
PhpSpreadsheet/samples/Calculations/Engineering/BESSELY.php
T
oleibman 641f86dc80 Eliminate Some "Mixed" Variables in Samples
A continuation of PR #3859. Change code that would be flagged if we were to run Phpstan at level 9 (we currently run level 8). I may or may not follow up with source code (454 level-9 problems remain for src), but there is no reason to avoid the effort for samples.

No changes are made to src.
2024-01-20 16:39:23 -08:00

27 lines
814 B
PHP

<?php
use PhpOffice\PhpSpreadsheet\Calculation\Calculation;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
require __DIR__ . '/../../Header.php';
$category = 'Engineering';
$functionName = 'BESSELY';
$description = 'Returns the Bessel function, which is also called the Weber function or the Neumann function';
$helper->titles($category, $functionName, $description);
// Create new PhpSpreadsheet object
$spreadsheet = new Spreadsheet();
$worksheet = $spreadsheet->getActiveSheet();
for ($n = 0; $n <= 5; ++$n) {
for ($x = 0; $x <= 5; $x = $x + 0.25) {
Calculation::getInstance($spreadsheet)->flushInstance();
$formula = "BESSELY({$x}, {$n})";
$worksheet->setCellValue('A1', "=$formula");
$helper->log("$formula = " . $worksheet->getCell('A1')->getCalculatedValue());
}
}