Examples
User documentation
BigRatInterval is designed to represent (finite, non-empty) intervals
with BigRat rational end points.
Constructors and pseudo-constructors
BigRatInterval(lwb, upb)creates an interval with lower end pointlwband upper end pointupb; gives error iflwb > upb
Queries and views
Let I be a BigRatInterval
min(I)-- gives the lower end point ofImax(I)-- gives the upper end point ofIwidth(I)-- gives the width ofIas aBigRatIsZeroInside(I)-- true iffmin(I) < 0 and max(I) > 0
Operations
Basic interval arithmetic operations between two intervals I1 and I2:
I1 + I2I1 - I2I1 * I2I1 / I2gives error ifI2contains 0merge(I1, I2)union, but error ifI1andI2are disjoint.square(I1)likeI1*I1but ensures lower bound is non-negative.soften(I1)widenI1to make its end points nicer numbers (PROTOTYPE!)
Basic arithmetic operations between an interval I and a rational q:
I + qandq + II - qandq - II * qandq * I
Division is not yet supported!
Maintainer documentation
I have preferred simplicity over efficiency for this first version.
Bugs, shortcomings and other ideas
Not efficient!
What should the interface to soften be? Is there a better fn name?
Main changes
2018
- April (v0.99563): first release