Numeric::mysql_sqrt()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Vectorface\MySQLite\MySQL;
4
5
/**
6
 * Provides Numeric MySQL compatibility functions for SQLite.
7
 *
8
 * http://dev.mysql.com/doc/refman/5.7/en/numeric-functions.html
9
 */
10
trait Numeric
11
{
12
    /**
13
     * SQRT - Return the square root of the argument
14
     *
15
     * @param mixed $value A numeric value for which a square root is to be calculated.
16
     * @return float The square root of the given numeric value.
17
     */
18 1
    public static function mysql_sqrt($value)
19
    {
20 1
        return sqrt($value);
21
    }
22
23
    /**
24
     * RAND - Returns a random floating-point
25
     * @return float
26
     */
27 1
    public static function mysql_rand()
28
    {
29 1
        return mt_rand() / mt_getrandmax();
30
    }
31
}
32