atan2: fix output range description
This commit is contained in:
parent
3125365a15
commit
7e794373f4
@ -18,9 +18,9 @@ include!(concat!(env!("OUT_DIR"), "/cossin_table.rs"));
|
|||||||
/// # Returns
|
/// # Returns
|
||||||
///
|
///
|
||||||
/// The angle between the x-axis and the ray to the point (x,y). The
|
/// The angle between the x-axis and the ray to the point (x,y). The
|
||||||
/// result range is from i32::MIN+1 to i32::MAX, where i32::MIN+1
|
/// result range is from i32::MIN to i32::MAX, where i32::MIN
|
||||||
/// corresponds to an angle of -pi and i32::MAX corresponds to an
|
/// represents -pi and, equivalently, +pi. i32::MAX represents one
|
||||||
/// angle of +pi.
|
/// count less than +pi.
|
||||||
pub fn atan2(y: i32, x: i32) -> i32 {
|
pub fn atan2(y: i32, x: i32) -> i32 {
|
||||||
let mut y = y >> 16;
|
let mut y = y >> 16;
|
||||||
let mut x = x >> 16;
|
let mut x = x >> 16;
|
||||||
|
Loading…
Reference in New Issue
Block a user