This repository has been archived by the owner on Dec 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andrés Correa Casablanca
committed
Jul 5, 2017
1 parent
9028f98
commit 16ba575
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Litipk\BigNumbers\Decimal; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class issue58Test extends TestCase | ||
{ | ||
public function test_that_fromString_preserves_the_correct_inner_scale_to_avoid_divisions_by_zero() | ||
{ | ||
$value = Decimal::create('12.99', 4); | ||
$divisor = Decimal::create(2, 4); | ||
|
||
$this->assertEquals(6.495, $value->div($divisor)->asFloat()); | ||
} | ||
} |