-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
interval diameter (length, width, measure, range, or size) #79
Comments
Just to weigh in, interval length is mathematically well-defined for any type of interval. The length of a real interval is usually defined as I am aware that portion does not support discrete intervals explicitly. But for discrete intervals, the size of an interval is its set order. If the interval is open, the open endpoint is not part of the set of course. Interval size plays an important role in integration theory and real analysis. However, my use case scenario is scheduling applications. Thank you, |
What would be the length of the empty interval, without loss of generality about the objects being used as bounds? Notice that if you really need to compute the length of (numerical) intervals, you can already define your own function that accepts an interval and returns its length, or you can subclass the |
Just like unbounded intervals, the length of an empty interval could be 0 or undefined, depending on the domain. A possible solution to keep the generality would be to define a default value for these special cases, but let the user change it. In any case, thanks for the suggestion. I'm subclassing I did it like this:
Many thanks |
I only need bounded and non-empty
|
Hi. I think that's ok w.r.t. breaking changes. However, I don't think it's a good idea to create atomic intervals using the constructor of the |
That's probably better, thank you. |
Yes, intervals are immutable so any property can be computed and cached at creation time. |
Interval length can be easily calculated using the properties upper and lower for bounded intervals.
It could be helpful to have a property to hold the interval length. What value should be set in the case of unbounded intervals though?
Thank you
The text was updated successfully, but these errors were encountered: