Conditions | 4 |
Paths | 4 |
Total Lines | 27 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
37 | private function __construct(float|int|string $number) |
||
38 | { |
||
39 | $e = 0; |
||
40 | $number = Number::expand_compact_decimal_exponent($number, $e); |
||
41 | |||
42 | [ $integer, $fractional ] = Number::parse($number); |
||
43 | |||
44 | $n = abs($number); |
||
45 | |||
46 | if ($fractional === null || (int)$fractional === 0) { |
||
47 | $n = (int)$n; |
||
48 | } |
||
49 | |||
50 | $this->n = $n; |
||
51 | $this->i = $integer; |
||
52 | $this->e = $e; |
||
53 | |||
54 | if ($fractional === null) { |
||
55 | $this->v = 0; |
||
56 | $this->w = 0; |
||
57 | $this->f = 0; |
||
58 | $this->t = 0; |
||
59 | } else { |
||
60 | $this->v = strlen($fractional); |
||
61 | $this->w = strlen(rtrim($fractional, '0')); |
||
62 | $this->f = (int)ltrim($fractional, '0'); |
||
63 | $this->t = (int)trim($fractional, '0'); |
||
64 | } |
||
85 |