Skip to content

Commit 5bae771

Browse files
committed
Reproduce underflow (below 1e-9) bug.
1 parent fbb37a1 commit 5bae771

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

ReactKitCalculatorTests/OutputSpec.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,30 @@ class OutputSpec: QuickSpec
615615

616616
}
617617

618+
describe("underflow") {
619+
620+
it("`. 1 * = = = = = = = = * = `") {
621+
622+
p.input = "."
623+
p.input = "1"
624+
p.input = "*"
625+
for _ in 0..<7 {
626+
p.input = "="
627+
}
628+
629+
expect(p.output!).to(equal("0.00000001"))
630+
631+
p.input = "="
632+
expect(p.output!).to(equal("1e-9"))
633+
634+
p.input = "*"
635+
p.input = "="
636+
expect(p.output!).to(equal("1e-18"))
637+
638+
}
639+
640+
}
641+
618642
// TODO: add bracket feature
619643
// describe("bracket") {
620644
//

0 commit comments

Comments
 (0)