Code Duplication    Length = 14-14 lines in 2 locations

src/PhpSpreadsheet/Calculation/Engineering.php 2 locations

@@ 2042-2055 (lines=14) @@
2039
     * @param    string $complexNumber The complex number for which you want the common logarithm.
2040
     * @return    string
2041
     */
2042
    public static function IMLOG10($complexNumber)
2043
    {
2044
        $complexNumber = Functions::flattenSingleValue($complexNumber);
2045
2046
        $parsedComplex = self::parseComplex($complexNumber);
2047
2048
        if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) {
2049
            return Functions::NAN();
2050
        } elseif (($parsedComplex['real'] > 0.0) && ($parsedComplex['imaginary'] == 0.0)) {
2051
            return log10($parsedComplex['real']);
2052
        }
2053
2054
        return self::IMPRODUCT(log10(EULER), self::IMLN($complexNumber));
2055
    }
2056
2057
    /**
2058
     * IMLOG2
@@ 2068-2081 (lines=14) @@
2065
     * @param    string $complexNumber The complex number for which you want the base-2 logarithm.
2066
     * @return    string
2067
     */
2068
    public static function IMLOG2($complexNumber)
2069
    {
2070
        $complexNumber = Functions::flattenSingleValue($complexNumber);
2071
2072
        $parsedComplex = self::parseComplex($complexNumber);
2073
2074
        if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) {
2075
            return Functions::NAN();
2076
        } elseif (($parsedComplex['real'] > 0.0) && ($parsedComplex['imaginary'] == 0.0)) {
2077
            return log($parsedComplex['real'], 2);
2078
        }
2079
2080
        return self::IMPRODUCT(log(EULER, 2), self::IMLN($complexNumber));
2081
    }
2082
2083
    /**
2084
     * IMEXP