-
-
Notifications
You must be signed in to change notification settings - Fork 721
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
[doc-core:math] Documentation for core:math
package. (partials)
#4961
base: master
Are you sure you want to change the base?
Conversation
…procedure groups
… procedure groups
/* | ||
Return square root of given input. | ||
|
||
**Only accept floats** |
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
core/math/math.odin
Outdated
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) | ||
x_f16le :f16le = 50.0 ; sqrt_x_f16le := math.sqrt(x_f16le) | ||
x_f16be :f16be = 100 ; sqrt_x_f16be := math.sqrt(x_f16be) | ||
x_f32 :f32 = 4.89 ; sqrt_x_f32 := math.sqrt(x_f32) | ||
x_f32le :f32le = 3.14 ; sqrt_x_f32le := math.sqrt(x_f32le) | ||
x_f32be :f32be = 2.0 ; sqrt_x_f32be := math.sqrt(x_f32be) | ||
x_f64 :f64 = 0.0578 ; sqrt_x_f64 := math.sqrt(x_f64) | ||
x_f64le :f64le = 1000.6 ; sqrt_x_f64le := math.sqrt(x_f64le) | ||
x_f64be :f64be = 89.98 ; sqrt_x_f64be := math.sqrt(x_f64be) |
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.
Use the standard style convention here too please.
x_float: f64 = 4.0; sqrt_x_float := math.sqrt(x_float) // using default type of f64
x_f16: f16 = 30.90; sqrt_x_f16 := math.sqrt(x_f16)
x_f16le: f16le = 50.0; sqrt_x_f16le := math.sqrt(x_f16le)
x_f16be: f16be = 100; sqrt_x_f16be := math.sqrt(x_f16be)
x_f32: f32 = 4.89; sqrt_x_f32 := math.sqrt(x_f32)
x_f32le: f32le = 3.14; sqrt_x_f32le := math.sqrt(x_f32le)
x_f32be: f32be = 2.0; sqrt_x_f32be := math.sqrt(x_f32be)
x_f64: f64 = 0.0; sqrt_x_f64 := math.sqrt(x_f64)
x_f64le: f64le = 1000.0; sqrt_x_f64le := math.sqrt(x_f64le)
x_f64be: f64be = 89.98; sqrt_x_f64be := math.sqrt(x_f64be)
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.
Thank you! fixed it and added more examples for special cases according to Float_Class
…e conventions according to comment odin-lang/Odin#4961 (comment) and odin-lang/Odin#4961 (comment)
… types. added doc for `RAD_PER_DEG` and `DEG_PER_RAD` constant
Documented: (all of this will be gradually updated)
math.Float_Class
enummath.sqrt
proc groupmath.sin
proc groupmath.cos
proc groupmath.tan
proc groupmath.to_radians
proc groupmath.to_degrees
proc groupDEG_PER_RAD
constantRAD_PER_DEG
constantmath.asin
proc groupmath.acos
proc groupmath.atan
proc groupMore detail underlying explanation/issue in #2358 (comment)