pub struct number;Expand description
The type of numeric values.
The number type uses two internal representations, or subtypes:
integer (64-bit) and float (double-precision). Lua converts
between them automatically as needed, and math.type reveals the
subtype of a value. Integer literals like 3 create integers;
literals with a decimal point or exponent like 3.0 or 1e2 create
floats.
print(3 / 2) --> 1.5 (division always produces a float)
print(3 // 2) --> 1 (floor division)
print(2^10) --> 1024.0 (exponentiation produces a float)Trait Implementations§
Source§impl arithmetic for number
impl arithmetic for number
Source§impl comparison for number
impl comparison for number
Auto Trait Implementations§
impl Freeze for number
impl RefUnwindSafe for number
impl Send for number
impl Sync for number
impl Unpin for number
impl UnsafeUnpin for number
impl UnwindSafe for number
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