Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Commit 8d6b436

Browse files
authored
Merge pull request #53 from thomashoneyman/master
Add DivisionRing instance for ApproxNumber
2 parents 3a73f38 + 8985152 commit 8d6b436

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Test/StrongCheck/Data/ApproxNumber.purs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ instance ringApproxNumber :: Ring ApproxNumber where
3939

4040
instance commutativeRingApproxNumber :: CommutativeRing ApproxNumber
4141

42+
instance divisionRingApproxNumber :: DivisionRing ApproxNumber where
43+
recip (ApproxNumber x) = ApproxNumber (1.0 / x)
44+
4245
instance euclideanRingApproxNumber :: EuclideanRing ApproxNumber where
4346
degree (ApproxNumber x) = degree x
4447
div (ApproxNumber x) (ApproxNumber y) = ApproxNumber (x / y)

0 commit comments

Comments
 (0)