-
Notifications
You must be signed in to change notification settings - Fork 185
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
expose {number,time,utc}Interval #2075
Conversation
The negative intervals encoding fractional values is something that might be surprising—but I understand if we want to gloss over that. |
It took me a while to interpret this statement but you’re referring to |
yes! |
Okay, added more documentation, please approve. |
Plot.numberInterval(2) | ||
``` | ||
|
||
Given a number *period*, returns a corresponding range interval implementation. If *period* is a negative number, the resulting interval uses 1 / -*period*; this allows more precise results when *period* is a negative integer. The returned interval implements the *interval*.range, *interval*.floor, and *interval*.offset methods. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given a number *period*, returns a corresponding range interval implementation. If *period* is a negative number, the resulting interval uses 1 / -*period*; this allows more precise results when *period* is a negative integer. The returned interval implements the *interval*.range, *interval*.floor, and *interval*.offset methods. | |
Given a number *period*, returns a corresponding range interval implementation. If *period* is a negative number, the resulting interval uses 1 / -*period*; this allows more precise results. The returned interval implements the *interval*.range, *interval*.floor, and *interval*.offset methods. |
remove repeat — or did you mean "when period is a fractional value"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that’s what I meant, and no, I’m not repeating myself. There are two statements here:
- When period is a negative number, the resulting interval uses 1 / -period, and
- When period is a negative integer, the results are more precise as a result of (1).
If period is a negative number that is not a negative integer, it still works, but there’s not really any reason to do it. So these are saying two separate things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I’m not documenting that a period of 0.5 is automatically promoted to -2, but I feel like that’s an implementation detail that doesn’t need to be documented.)
/** | ||
* Given a number *period*, returns a corresponding numeric range interval. If | ||
* *period* is a negative number, the returned interval uses 1 / -*period*, | ||
* allowing greater precision when *period* is a negative integer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* allowing greater precision when *period* is a negative integer. | |
* allowing greater precision. |
same suggestion/question
Fixes #1994.