pub struct LuaMath {
pub pi: f64,
pub huge: f64,
}Expand description
Lua math library (Factorio uses deterministic implementations).
Fields§
§pi: f64§huge: f64Implementations§
Source§impl LuaMath
impl LuaMath
pub const fn new() -> Self
pub fn abs(&self, x: f64) -> f64
pub fn acos(&self, x: f64) -> f64
pub fn asin(&self, x: f64) -> f64
pub fn atan(&self, x: f64) -> f64
pub fn atan2(&self, y: f64, x: f64) -> f64
pub fn ceil(&self, x: f64) -> f64
pub fn cos(&self, x: f64) -> f64
pub fn cosh(&self, x: f64) -> f64
pub fn deg(&self, x: f64) -> f64
pub fn exp(&self, x: f64) -> f64
pub fn floor(&self, x: f64) -> f64
pub fn fmod(&self, x: f64, y: f64) -> f64
pub fn frexp(&self, x: f64) -> (f64, i32)
pub fn ldexp(&self, x: f64, exp: i32) -> f64
pub fn log(&self, x: f64) -> f64
pub fn log10(&self, x: f64) -> f64
pub fn max(&self, a: f64, b: f64) -> f64
pub fn min(&self, a: f64, b: f64) -> f64
pub fn modf(&self, x: f64) -> (f64, f64)
pub fn pow(&self, x: f64, y: f64) -> f64
pub fn rad(&self, x: f64) -> f64
Sourcepub fn random_int(&self, n: i64) -> i64
pub fn random_int(&self, n: i64) -> i64
math.random(n) - integer in [1, n]. Lowers as math.random.
Sourcepub fn random_range(&self, m: i64, n: i64) -> i64
pub fn random_range(&self, m: i64, n: i64) -> i64
math.random(m, n) - integer in [m, n]. Lowers as math.random.
Sourcepub fn randomseed(&self, seed: i64)
pub fn randomseed(&self, seed: i64)
No-op in Factorio; use LuaRandomGenerator for custom seeding.
pub fn sin(&self, x: f64) -> f64
pub fn sinh(&self, x: f64) -> f64
pub fn sqrt(&self, x: f64) -> f64
pub fn tan(&self, x: f64) -> f64
pub fn tanh(&self, x: f64) -> f64
Trait Implementations§
impl Copy for LuaMath
impl StructuralPartialEq for LuaMath
Auto Trait Implementations§
impl Freeze for LuaMath
impl RefUnwindSafe for LuaMath
impl Send for LuaMath
impl Sync for LuaMath
impl Unpin for LuaMath
impl UnsafeUnpin for LuaMath
impl UnwindSafe for LuaMath
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more