Skip to content

bug #28

@luzengxiang

Description

@luzengxiang

May have precision problem.
origin bound [0 , 1.00]
after split [ 0 - 0.9999]
Error arises when applied with actual data set.

def split (n: Int): List [BoundsInOneDimension] = {
    var result: List[BoundsInOneDimension] = Nil
    val increment = (upper - lower) / n
    var currentLowerBound = lower

    for (i <- 1 to n) {
      val include = if (i < n) false else this.includeHigherBound
      val newUpperBound = currentLowerBound + increment
      val newSplit = new BoundsInOneDimension(currentLowerBound, newUpperBound, include)
      result = newSplit :: result
      currentLowerBound = newUpperBound
    }

    result.reverse
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions