-
-
Notifications
You must be signed in to change notification settings - Fork 783
[doc-core:math] Documentation for core:math
package. (partials)
#4961
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
78669f4
ba51224
d15d6b5
17ffcbd
449e8bf
ab4270e
9d4ee04
4a21de5
0c50e4d
c4e93f0
7ed7800
70a37c5
177ad62
4af9e1e
ea4fe8c
cf3b50a
b7ad99c
1edeace
fc453bf
e54a541
b9ce613
293e89a
884cef0
c6bf715
dac5931
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
math.sqrt
procedure group
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,10 +52,16 @@ clamp :: builtin.clamp | |
@(require_results) sqrt_f64le :: proc "contextless" (x: f64le) -> f64le { return #force_inline f64le(sqrt_f64(f64(x))) } | ||
@(require_results) sqrt_f64be :: proc "contextless" (x: f64be) -> f64be { return #force_inline f64be(sqrt_f64(f64(x))) } | ||
/* | ||
Will return square root of given input. | ||
Return square root of given input. | ||
|
||
**Only accept floats** | ||
|
||
Inputs: | ||
- x: input value of type floats | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Although - `x`: Input value. Also please form a proper sentence when describing inputs and returns of a procedure. Meaning, capitalizing the first letter and putting a period at the end. You don't have to specify that |
||
|
||
Output: | ||
- x: ouput value that with same type of the input | ||
|
||
Example: | ||
x_float : = 4.0 ; sqrt_x_float := math.sqrt(x_float) // using default type of f16 | ||
x_f16 :f16 = 30.90 ; sqrt_x_f16 := math.sqrt(x_f16) | ||
|
@@ -68,6 +74,7 @@ Example: | |
x_f64le :f64le = 1000.6 ; sqrt_x_f64le := math.sqrt(x_f64le) | ||
x_f64be :f64be = 89.98 ; sqrt_x_f64be := math.sqrt(x_f64be) | ||
|
||
|
||
Output: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Your example doesn't "print" anything, so there's no "output". This is going to be a problem with the documentation tester that runs all examples inside documentation and checks the output. I suggest you reformat these examples to print results. Might help to not focus on types as much as on values. |
||
2 // `f64` | ||
5.559 // `f16` | ||
|
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 would probably also document the behavior for when the input is an
inf
,nan
, a negative zero and possibly subnormal.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.
yeah, that is a good point! I added more examples for the special cases according to
Float_Class
enum