sin
fn sin(float x) -> float
Source: compiler/src/builtin_docs/prelude/math.hy Returns the sine of x (in radians).
Like every scalar function in prelude::math, it takes and returns
float and follows IEEE-754: invalid inputs give NaN and overflow gives
infinity, never a clamped value. Auto-imported.
Parameters#
| Name | Type |
|---|---|
x | float |
Returns#
float
Examples#
use tests::assert;
let pi = 3.141592653589793;
assert!(sin(0.0) == 0.0);
assert!(sin(pi / 2.0) == 1.0);
See also#
prelude::mathfloatcos: Returns the cosine ofx(in radians).tan: Returns the tangent ofx(in radians).sqrt: Returns the square root ofx.floor: Returns the largest whole number less than or equal tox, as afloat.ceil: Returns the smallest whole number greater than or equal tox, as afloat.exp: Returnseraised to the powerx.