Completed
Push — master ( 9028f9...16ba57 )
by Andreu
02:49
created

issue58Test   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 10
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_that_fromString_preserves_the_correct_inner_scale_to_avoid_divisions_by_zero() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
use Litipk\BigNumbers\Decimal;
6
use PHPUnit\Framework\TestCase;
7
8
class issue58Test extends TestCase
9
{
10
    public function test_that_fromString_preserves_the_correct_inner_scale_to_avoid_divisions_by_zero()
11
    {
12
        $value = Decimal::create('12.99', 4);
13
        $divisor = Decimal::create(2, 4);
14
15
        $this->assertEquals(6.495, $value->div($divisor)->asFloat());
16
    }
17
}