Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/src/main/scala/spire/math/Interval.scala
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ sealed abstract class Interval[A] extends Serializable { lhs =>
case All() =>
"(-∞, ∞)"
case Empty() =>
"(Ø)"
"()"
case Above(lower, flags) =>
if (isClosedLower(flags)) s"[$lower, ∞)" else s"($lower, ∞)"
case Below(upper, flags) =>
Expand Down Expand Up @@ -949,7 +949,7 @@ object Interval {
def atOrAbove[A: Order](a: A): Interval[A] = Above(a, 0)
def atOrBelow[A: Order](a: A): Interval[A] = Below(a, 0)

private val NullRe = "^ *\\( *Ø *\\) *$".r
private val NullRe = "^ *\\( * *\\) *$".r
private val SingleRe = "^ *\\[ *([^,]+) *\\] *$".r
private val PairRe = "^ *(\\[|\\() *(.+?) *, *(.+?) *(\\]|\\)) *$".r

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/spire/math/interval/Overlap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ object Overlap {

/**
* [[inner]] is a subset of [[outer]]. Empty interval is always a subset of any other, so all overlaps on empty
* intervals go here, except `(Ø).overlap(Ø)`, that results in equality.
* intervals go here, except `().overlap()`, that results in equality.
*
* For example [1,4) and [1, 5]
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class IntervalOverlapScalaCheckSuite extends munit.ScalaCheckSuite {
}
}

property("(x overlap Ø) = Subset(Ø, x) id x != Ø") {
property("(x overlap ) = Subset(, x) id x != ") {
forAll { (x: Interval[Rational]) =>
(x.nonEmpty) ==> {
val empty = Interval.empty[Rational]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class IntervalScalaCheckSuite extends munit.ScalaCheckSuite {

val rng = spire.random.GlobalRng

property("(x -- y) ⊆ x && (x -- y) & y = Ø") {
property("(x -- y) ⊆ x && (x -- y) & y = ") {
forAll { (x: Interval[Rational], y: Interval[Rational]) =>
(x -- y).foreach { zi =>
(zi.isSubsetOf(x)) &&
Expand All @@ -56,21 +56,21 @@ class IntervalScalaCheckSuite extends munit.ScalaCheckSuite {
}
}

property("(x -- Ø) = x") {
property("(x -- ) = x") {
forAll { (x: Interval[Rational]) =>
if (x.nonEmpty) {
(x -- Interval.empty[Rational]) == List(x)
} else true
}
}

property("(x -- x) = Ø") {
property("(x -- x) = ") {
forAll { (x: Interval[Rational]) =>
(x -- x) == Nil
}
}

property("(x -- (-∞, ∞)) = Ø") {
property("(x -- (-∞, ∞)) = ") {
forAll { (x: Interval[Rational]) =>
(x -- Interval.all[Rational]) == Nil
}
Expand Down
2 changes: 1 addition & 1 deletion tests/shared/src/test/scala/spire/math/IntervalSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class IntervalSuite extends munit.FunSuite {
test("Interval.closed(0, 5).isBounded is true") { assert(Interval.closed(0, 5).isBounded) }

test("Interval.point(2).toString == [2]") { assertEquals(Interval.point(2).toString, "[2]") }
test("Interval.empty.toString == (Ø)") { assertEquals(Interval.empty[Int].toString, "(Ø)") }
test("Interval.empty.toString == ()") { assertEquals(Interval.empty[Int].toString, "()") }

val a = cc(0.0, 4.0)
test("a.contains(0.0) is true") { assertEquals(a.contains(0.0), true) }
Expand Down