Code Duplication    Length = 10-10 lines in 6 locations

src/BCMathExtended/BC.php 6 locations

@@ 88-97 (lines=10) @@
85
     * @param int $scale
86
     * @return string
87
     */
88
    public static function mul($leftOperand, $rightOperand, $scale = null)
89
    {
90
        $leftOperand = self::convertScientificNotationToString($leftOperand);
91
        $rightOperand = self::convertScientificNotationToString($rightOperand);
92
93
        if (null === $scale) {
94
            return bcmul($leftOperand, $rightOperand);
95
        }
96
97
        return bcmul($leftOperand, $rightOperand, $scale);
98
    }
99
100
    /**
@@ 106-115 (lines=10) @@
103
     * @param int $scale
104
     * @return string
105
     */
106
    public static function pow($leftOperand, $rightOperand, $scale = null)
107
    {
108
        $leftOperand = self::convertScientificNotationToString($leftOperand);
109
        $rightOperand = self::convertScientificNotationToString($rightOperand);
110
111
        if (null === $scale) {
112
            return bcpow($leftOperand, $rightOperand);
113
        }
114
115
        return bcpow($leftOperand, $rightOperand, $scale);
116
    }
117
118
    /**
@@ 124-133 (lines=10) @@
121
     * @param int $scale
122
     * @return string
123
     */
124
    public static function div($leftOperand, $rightOperand, $scale = null)
125
    {
126
        $leftOperand = self::convertScientificNotationToString($leftOperand);
127
        $rightOperand = self::convertScientificNotationToString($rightOperand);
128
129
        if (null === $scale) {
130
            return bcdiv($leftOperand, $rightOperand);
131
        }
132
133
        return bcdiv($leftOperand, $rightOperand, $scale);
134
    }
135
136
    /**
@@ 174-183 (lines=10) @@
171
     * @param int $scale
172
     * @return string
173
     */
174
    public static function sub($leftOperand, $rightOperand, $scale = null)
175
    {
176
        $leftOperand = self::convertScientificNotationToString($leftOperand);
177
        $rightOperand = self::convertScientificNotationToString($rightOperand);
178
179
        if (null === $scale) {
180
            return bcsub($leftOperand, $rightOperand);
181
        }
182
183
        return bcsub($leftOperand, $rightOperand, $scale);
184
    }
185
186
    /**
@@ 192-201 (lines=10) @@
189
     * @param int $scale
190
     * @return string
191
     */
192
    public static function add($leftOperand, $rightOperand, $scale = null)
193
    {
194
        $leftOperand = self::convertScientificNotationToString($leftOperand);
195
        $rightOperand = self::convertScientificNotationToString($rightOperand);
196
197
        if (null === $scale) {
198
            return bcadd($leftOperand, $rightOperand);
199
        }
200
201
        return bcadd($leftOperand, $rightOperand, $scale);
202
    }
203
204
    /**
@@ 466-475 (lines=10) @@
463
     * @param int $scale
464
     * @return string
465
     */
466
    public static function powMod($leftOperand, $rightOperand, $modulus, $scale = null)
467
    {
468
        $leftOperand = self::convertScientificNotationToString($leftOperand);
469
        $rightOperand = self::convertScientificNotationToString($rightOperand);
470
471
        if (null === $scale) {
472
            return bcpowmod($leftOperand, $rightOperand, $modulus);
473
        }
474
475
        return bcpowmod($leftOperand, $rightOperand, $modulus, $scale);
476
    }
477
}
478