Conversation
README.md
Outdated
| false | ||
| ``` | ||
|
|
||
| Remainder: |
There was a problem hiding this comment.
I realise that the readme already had examples in, but I think examples should go into the doc-comments instead, so that they can be seen on Pursuit.
There was a problem hiding this comment.
I agree about examples in the doc-comments. I'd be happy to completely rework the README to give a shorter and more general overview of the functions Data.Number supports but that will mean changing what was already there before this PR.
There was a problem hiding this comment.
That sounds good to me, thanks!
There was a problem hiding this comment.
After some delay (my apologies), this should now be resolved in 626e299
README.md
Outdated
|
|
||
| Trignometric functions: | ||
| ```purs | ||
| > sin 0.0 |
There was a problem hiding this comment.
We have an opportunity to clarify that sin takes radians here; how about using pi/2 as the value?
There was a problem hiding this comment.
I agree but I missed this in the last commit. I'll fix shortly.
Co-authored-by: Harry Garrood <harry@garrood.me>
Co-authored-by: Harry Garrood <harry@garrood.me>
|
@hdgarrood Over on purescript/purescript#2980 you express hesitancy on polyfills that mutate the Math object. This repo contains a polyfill for That doesn't look to me like it mutates the Math object but I'm certainly no expert on Javascript. If you have concerns over |
|
No, that looks fine! That won’t mutate Math, it’ll just use Math.sign if it exists and otherwise it’ll use the polyfill. |
|
One final tweak. I've switched |
As noted in the Math issue (my comment), we need to decide whether to replicate more functions added to the Math object in ES6.
|
🏓 @thomashoneyman This should be ready to go now. |
|
I haven't been involved in these discussions, so I'd appreciate if perhaps @hdgarrood could take another look. If not, I can review, but I don't necessarily have the correct background to make these decisions. |
hdgarrood
left a comment
There was a problem hiding this comment.
I have a couple of minor docs suggestions but this look great 👍
src/Data/Number.purs
Outdated
|
|
||
| -- | Returns `e` exponentiated to the power of the argument. | ||
| -- | ```purs | ||
| -- | > exp 0.0 |
There was a problem hiding this comment.
I feel like exp 1.0 might be a better example here; any function of the form \x -> pow a x for some a is going to take 0.0 to 1.0.
There was a problem hiding this comment.
Fixed in latest commit.
src/Data/Number.purs
Outdated
|
|
||
| -- | Returns the natural logarithm of a number. | ||
| -- | ```purs | ||
| -- | > log 1.0 |
There was a problem hiding this comment.
Same here - maybe log e would be more illustrative here? I realise you have that same example on the documentation for e but I think repetition here is fine, especially as people might be linked directly to the documentation for exp and log and not see e.
There was a problem hiding this comment.
Fixed in latest commit.
Introduces many of the functions currently living in purescript-math. Closes #17. See also purescript-deprecated/purescript-math#31.
Checklist: