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
chore(docs): Add examples to Number
module
#2015
Conversation
Let's make sure something akin to #2032 is merged before we land this. |
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.
Needs conflicts resolved since we removed some trig functions
824e16b
to
2cb30b8
Compare
@spotandjake more conflicts (due to atan2?) |
deb22de
to
f424643
Compare
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.
LGTM but getting @ospencer or @alex-snezhko review
Number
docsNumber
module
@@ -337,6 +409,13 @@ provide let isInteger = (x: Number) => { | |||
* @param x: The number to check | |||
* @returns `true` if the value is a non-integer rational number or `false` otherwise | |||
* | |||
* @example Number.isRational(1/2) |
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 == true here?
* @example Number.isFinite(1/2) | ||
* @example Number.isFinite(0.5) | ||
* @example Number.isFinite(1.0) | ||
* @example Number.isFinite(1) |
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.
And these?
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.
Or is this our style? Just feels a little weird since it's not an assertion.
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 haven't been paying that close of attention. I know jake was doing assert in some cases.
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.
We have been using assert
semantics for single line matches throughout the stdlib.
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.
@spotandjake why don't these contain assert
then?
This pr improves the documentation on the
Number
module, by adding examples to most functions. It also adds a missingsince
property toNumber.sign
.Notes:
Range
until we have proper syntax.sin
,cos
,tan
,gamma
,factorial
functions #1478 had been an issue to makeNumber.sin
unbounded, but I noticed during this pr that was not the actual problem, the problem is how we map the input range and also with our implementation.