#[repr(transparent)]pub struct Fixed<I, const B: u32>(_);
Expand description
A fixed-point number. This transparently wraps an integer with a const generic for how many bits are fractional.
- This type is generic, but the
I
type is intended to be a signed or unsigned integer of a fixed bit size:i8
,i16
,i32
,u8
,u16
, oru32
. This type is not semver supported to work with any otherI
type. If it does work for other types ofI
, that’s on accident. - The
B
value is the number of bits that form the fractional part. It should be less than the number of bits in the integer’s type. Multiply and divide ops need to shift the value byB
, and so ifB
is greater than or equal to the integer’s size the op will panic.
Implementations§
source§impl<const B: u32> Fixed<i8, B>
impl<const B: u32> Fixed<i8, B>
source§impl<const B: u32> Fixed<i16, B>
impl<const B: u32> Fixed<i16, B>
sourcepub const fn wrapping_from(i: i16) -> Self
pub const fn wrapping_from(i: i16) -> Self
Shifts the value left by B
, wrapping it into the range of this Fixed
type.
sourcepub const fn from_raw(i: i16) -> Self
pub const fn from_raw(i: i16) -> Self
Makes a Fixed
directly from a raw inner value (no shift).
source§impl<const B: u32> Fixed<i32, B>
impl<const B: u32> Fixed<i32, B>
sourcepub const fn wrapping_from(i: i32) -> Self
pub const fn wrapping_from(i: i32) -> Self
Shifts the value left by B
, wrapping it into the range of this Fixed
type.
Examples found in repository?
examples/hello.rs (line 43)
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
extern "C" fn main() -> ! {
RUST_IRQ_HANDLER.write(Some(irq_handler));
DISPSTAT.write(DisplayStatus::new().with_irq_vblank(true));
IE.write(IrqBits::VBLANK);
IME.write(true);
if let Ok(mut logger) = MgbaBufferedLogger::try_new(MgbaMessageLevel::Debug) {
writeln!(logger, "hello!").ok();
let fx_u: Fixed<u32, 8> =
Fixed::<u32, 8>::wrapping_from(7) + Fixed::<u32, 8>::from_raw(12);
writeln!(logger, "fixed unsigned: {fx_u:?}").ok();
let fx_i1: Fixed<i32, 8> =
Fixed::<i32, 8>::wrapping_from(8) + Fixed::<i32, 8>::from_raw(15);
writeln!(logger, "fixed signed positive: {fx_i1:?}").ok();
let fx_i2: Fixed<i32, 8> = Fixed::<i32, 8>::wrapping_from(0)
- Fixed::<i32, 8>::wrapping_from(3)
- Fixed::<i32, 8>::from_raw(17);
writeln!(logger, "fixed signed negative: {fx_i2:?}").ok();
}
{
// get our tile data into memory.
Cga8x8Thick.bitunpack_4bpp(CHARBLOCK0_4BPP.as_region(), 0);
}
{
// set up the tilemap
let tsb = TEXT_SCREENBLOCKS.get_frame(31).unwrap();
for y in 0..16 {
let row = tsb.get_row(y).unwrap();
for (x, addr) in row.iter().enumerate().take(16) {
let te = TextEntry::new().with_tile((y * 16 + x) as u16);
addr.write(te);
}
}
}
{
// Set BG0 to use the tilemap we just made, and set it to be shown.
BG0CNT.write(BackgroundControl::new().with_screenblock(31));
DISPCNT.write(DisplayControl::new().with_show_bg0(true));
}
let mut x_off = 0_u32;
let mut y_off = 0_u32;
let mut backdrop_color = Color(0);
loop {
VBlankIntrWait();
// show current frame
BACKDROP_COLOR.write(backdrop_color);
BG0HOFS.write(x_off as u16);
BG0VOFS.write(y_off as u16);
// prep next frame
let k = FRAME_KEYS.read();
backdrop_color = Color(k.to_u16());
if k.up() {
y_off = y_off.wrapping_add(1);
}
if k.down() {
y_off = y_off.wrapping_sub(1);
}
if k.left() {
x_off = x_off.wrapping_add(1);
}
if k.right() {
x_off = x_off.wrapping_sub(1);
}
}
}
sourcepub const fn from_raw(i: i32) -> Self
pub const fn from_raw(i: i32) -> Self
Makes a Fixed
directly from a raw inner value (no shift).
Examples found in repository?
examples/hello.rs (line 43)
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
extern "C" fn main() -> ! {
RUST_IRQ_HANDLER.write(Some(irq_handler));
DISPSTAT.write(DisplayStatus::new().with_irq_vblank(true));
IE.write(IrqBits::VBLANK);
IME.write(true);
if let Ok(mut logger) = MgbaBufferedLogger::try_new(MgbaMessageLevel::Debug) {
writeln!(logger, "hello!").ok();
let fx_u: Fixed<u32, 8> =
Fixed::<u32, 8>::wrapping_from(7) + Fixed::<u32, 8>::from_raw(12);
writeln!(logger, "fixed unsigned: {fx_u:?}").ok();
let fx_i1: Fixed<i32, 8> =
Fixed::<i32, 8>::wrapping_from(8) + Fixed::<i32, 8>::from_raw(15);
writeln!(logger, "fixed signed positive: {fx_i1:?}").ok();
let fx_i2: Fixed<i32, 8> = Fixed::<i32, 8>::wrapping_from(0)
- Fixed::<i32, 8>::wrapping_from(3)
- Fixed::<i32, 8>::from_raw(17);
writeln!(logger, "fixed signed negative: {fx_i2:?}").ok();
}
{
// get our tile data into memory.
Cga8x8Thick.bitunpack_4bpp(CHARBLOCK0_4BPP.as_region(), 0);
}
{
// set up the tilemap
let tsb = TEXT_SCREENBLOCKS.get_frame(31).unwrap();
for y in 0..16 {
let row = tsb.get_row(y).unwrap();
for (x, addr) in row.iter().enumerate().take(16) {
let te = TextEntry::new().with_tile((y * 16 + x) as u16);
addr.write(te);
}
}
}
{
// Set BG0 to use the tilemap we just made, and set it to be shown.
BG0CNT.write(BackgroundControl::new().with_screenblock(31));
DISPCNT.write(DisplayControl::new().with_show_bg0(true));
}
let mut x_off = 0_u32;
let mut y_off = 0_u32;
let mut backdrop_color = Color(0);
loop {
VBlankIntrWait();
// show current frame
BACKDROP_COLOR.write(backdrop_color);
BG0HOFS.write(x_off as u16);
BG0VOFS.write(y_off as u16);
// prep next frame
let k = FRAME_KEYS.read();
backdrop_color = Color(k.to_u16());
if k.up() {
y_off = y_off.wrapping_add(1);
}
if k.down() {
y_off = y_off.wrapping_sub(1);
}
if k.left() {
x_off = x_off.wrapping_add(1);
}
if k.right() {
x_off = x_off.wrapping_sub(1);
}
}
}
source§impl<const B: u32> Fixed<u8, B>
impl<const B: u32> Fixed<u8, B>
source§impl<const B: u32> Fixed<u16, B>
impl<const B: u32> Fixed<u16, B>
sourcepub const fn wrapping_from(i: u16) -> Self
pub const fn wrapping_from(i: u16) -> Self
Shifts the value left by B
, wrapping it into the range of this Fixed
type.
sourcepub const fn from_raw(i: u16) -> Self
pub const fn from_raw(i: u16) -> Self
Makes a Fixed
directly from a raw inner value (no shift).
source§impl<const B: u32> Fixed<u32, B>
impl<const B: u32> Fixed<u32, B>
sourcepub const fn wrapping_from(i: u32) -> Self
pub const fn wrapping_from(i: u32) -> Self
Shifts the value left by B
, wrapping it into the range of this Fixed
type.
Examples found in repository?
examples/hello.rs (line 39)
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
extern "C" fn main() -> ! {
RUST_IRQ_HANDLER.write(Some(irq_handler));
DISPSTAT.write(DisplayStatus::new().with_irq_vblank(true));
IE.write(IrqBits::VBLANK);
IME.write(true);
if let Ok(mut logger) = MgbaBufferedLogger::try_new(MgbaMessageLevel::Debug) {
writeln!(logger, "hello!").ok();
let fx_u: Fixed<u32, 8> =
Fixed::<u32, 8>::wrapping_from(7) + Fixed::<u32, 8>::from_raw(12);
writeln!(logger, "fixed unsigned: {fx_u:?}").ok();
let fx_i1: Fixed<i32, 8> =
Fixed::<i32, 8>::wrapping_from(8) + Fixed::<i32, 8>::from_raw(15);
writeln!(logger, "fixed signed positive: {fx_i1:?}").ok();
let fx_i2: Fixed<i32, 8> = Fixed::<i32, 8>::wrapping_from(0)
- Fixed::<i32, 8>::wrapping_from(3)
- Fixed::<i32, 8>::from_raw(17);
writeln!(logger, "fixed signed negative: {fx_i2:?}").ok();
}
{
// get our tile data into memory.
Cga8x8Thick.bitunpack_4bpp(CHARBLOCK0_4BPP.as_region(), 0);
}
{
// set up the tilemap
let tsb = TEXT_SCREENBLOCKS.get_frame(31).unwrap();
for y in 0..16 {
let row = tsb.get_row(y).unwrap();
for (x, addr) in row.iter().enumerate().take(16) {
let te = TextEntry::new().with_tile((y * 16 + x) as u16);
addr.write(te);
}
}
}
{
// Set BG0 to use the tilemap we just made, and set it to be shown.
BG0CNT.write(BackgroundControl::new().with_screenblock(31));
DISPCNT.write(DisplayControl::new().with_show_bg0(true));
}
let mut x_off = 0_u32;
let mut y_off = 0_u32;
let mut backdrop_color = Color(0);
loop {
VBlankIntrWait();
// show current frame
BACKDROP_COLOR.write(backdrop_color);
BG0HOFS.write(x_off as u16);
BG0VOFS.write(y_off as u16);
// prep next frame
let k = FRAME_KEYS.read();
backdrop_color = Color(k.to_u16());
if k.up() {
y_off = y_off.wrapping_add(1);
}
if k.down() {
y_off = y_off.wrapping_sub(1);
}
if k.left() {
x_off = x_off.wrapping_add(1);
}
if k.right() {
x_off = x_off.wrapping_sub(1);
}
}
}
sourcepub const fn from_raw(i: u32) -> Self
pub const fn from_raw(i: u32) -> Self
Makes a Fixed
directly from a raw inner value (no shift).
Examples found in repository?
examples/hello.rs (line 39)
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
extern "C" fn main() -> ! {
RUST_IRQ_HANDLER.write(Some(irq_handler));
DISPSTAT.write(DisplayStatus::new().with_irq_vblank(true));
IE.write(IrqBits::VBLANK);
IME.write(true);
if let Ok(mut logger) = MgbaBufferedLogger::try_new(MgbaMessageLevel::Debug) {
writeln!(logger, "hello!").ok();
let fx_u: Fixed<u32, 8> =
Fixed::<u32, 8>::wrapping_from(7) + Fixed::<u32, 8>::from_raw(12);
writeln!(logger, "fixed unsigned: {fx_u:?}").ok();
let fx_i1: Fixed<i32, 8> =
Fixed::<i32, 8>::wrapping_from(8) + Fixed::<i32, 8>::from_raw(15);
writeln!(logger, "fixed signed positive: {fx_i1:?}").ok();
let fx_i2: Fixed<i32, 8> = Fixed::<i32, 8>::wrapping_from(0)
- Fixed::<i32, 8>::wrapping_from(3)
- Fixed::<i32, 8>::from_raw(17);
writeln!(logger, "fixed signed negative: {fx_i2:?}").ok();
}
{
// get our tile data into memory.
Cga8x8Thick.bitunpack_4bpp(CHARBLOCK0_4BPP.as_region(), 0);
}
{
// set up the tilemap
let tsb = TEXT_SCREENBLOCKS.get_frame(31).unwrap();
for y in 0..16 {
let row = tsb.get_row(y).unwrap();
for (x, addr) in row.iter().enumerate().take(16) {
let te = TextEntry::new().with_tile((y * 16 + x) as u16);
addr.write(te);
}
}
}
{
// Set BG0 to use the tilemap we just made, and set it to be shown.
BG0CNT.write(BackgroundControl::new().with_screenblock(31));
DISPCNT.write(DisplayControl::new().with_show_bg0(true));
}
let mut x_off = 0_u32;
let mut y_off = 0_u32;
let mut backdrop_color = Color(0);
loop {
VBlankIntrWait();
// show current frame
BACKDROP_COLOR.write(backdrop_color);
BG0HOFS.write(x_off as u16);
BG0VOFS.write(y_off as u16);
// prep next frame
let k = FRAME_KEYS.read();
backdrop_color = Color(k.to_u16());
if k.up() {
y_off = y_off.wrapping_add(1);
}
if k.down() {
y_off = y_off.wrapping_sub(1);
}
if k.left() {
x_off = x_off.wrapping_add(1);
}
if k.right() {
x_off = x_off.wrapping_sub(1);
}
}
}
source§impl<const B: u32> Fixed<i8, B>
impl<const B: u32> Fixed<i8, B>
sourcepub const fn is_negative(self) -> bool
pub const fn is_negative(self) -> bool
If the number is negative or not.
source§impl<const B: u32> Fixed<i16, B>
impl<const B: u32> Fixed<i16, B>
sourcepub const fn is_negative(self) -> bool
pub const fn is_negative(self) -> bool
If the number is negative or not.
source§impl<const B: u32> Fixed<i32, B>
impl<const B: u32> Fixed<i32, B>
sourcepub const fn is_negative(self) -> bool
pub const fn is_negative(self) -> bool
If the number is negative or not.
Trait Implementations§
source§impl<const B: u32> AddAssign<Fixed<i16, B>> for Fixed<i16, B>
impl<const B: u32> AddAssign<Fixed<i16, B>> for Fixed<i16, B>
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moresource§impl<const B: u32> AddAssign<Fixed<i32, B>> for Fixed<i32, B>
impl<const B: u32> AddAssign<Fixed<i32, B>> for Fixed<i32, B>
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moresource§impl<const B: u32> AddAssign<Fixed<i8, B>> for Fixed<i8, B>
impl<const B: u32> AddAssign<Fixed<i8, B>> for Fixed<i8, B>
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moresource§impl<const B: u32> AddAssign<Fixed<u16, B>> for Fixed<u16, B>
impl<const B: u32> AddAssign<Fixed<u16, B>> for Fixed<u16, B>
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moresource§impl<const B: u32> AddAssign<Fixed<u32, B>> for Fixed<u32, B>
impl<const B: u32> AddAssign<Fixed<u32, B>> for Fixed<u32, B>
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moresource§impl<const B: u32> AddAssign<Fixed<u8, B>> for Fixed<u8, B>
impl<const B: u32> AddAssign<Fixed<u8, B>> for Fixed<u8, B>
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
Performs the
+=
operation. Read moresource§impl<const B: u32> BitAndAssign<Fixed<i16, B>> for Fixed<i16, B>
impl<const B: u32> BitAndAssign<Fixed<i16, B>> for Fixed<i16, B>
source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the
&=
operation. Read moresource§impl<const B: u32> BitAndAssign<Fixed<i32, B>> for Fixed<i32, B>
impl<const B: u32> BitAndAssign<Fixed<i32, B>> for Fixed<i32, B>
source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the
&=
operation. Read moresource§impl<const B: u32> BitAndAssign<Fixed<i8, B>> for Fixed<i8, B>
impl<const B: u32> BitAndAssign<Fixed<i8, B>> for Fixed<i8, B>
source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the
&=
operation. Read moresource§impl<const B: u32> BitAndAssign<Fixed<u16, B>> for Fixed<u16, B>
impl<const B: u32> BitAndAssign<Fixed<u16, B>> for Fixed<u16, B>
source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the
&=
operation. Read moresource§impl<const B: u32> BitAndAssign<Fixed<u32, B>> for Fixed<u32, B>
impl<const B: u32> BitAndAssign<Fixed<u32, B>> for Fixed<u32, B>
source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the
&=
operation. Read moresource§impl<const B: u32> BitAndAssign<Fixed<u8, B>> for Fixed<u8, B>
impl<const B: u32> BitAndAssign<Fixed<u8, B>> for Fixed<u8, B>
source§fn bitand_assign(&mut self, rhs: Self)
fn bitand_assign(&mut self, rhs: Self)
Performs the
&=
operation. Read moresource§impl<const B: u32> BitOrAssign<Fixed<i16, B>> for Fixed<i16, B>
impl<const B: u32> BitOrAssign<Fixed<i16, B>> for Fixed<i16, B>
source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|=
operation. Read moresource§impl<const B: u32> BitOrAssign<Fixed<i32, B>> for Fixed<i32, B>
impl<const B: u32> BitOrAssign<Fixed<i32, B>> for Fixed<i32, B>
source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|=
operation. Read moresource§impl<const B: u32> BitOrAssign<Fixed<i8, B>> for Fixed<i8, B>
impl<const B: u32> BitOrAssign<Fixed<i8, B>> for Fixed<i8, B>
source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|=
operation. Read moresource§impl<const B: u32> BitOrAssign<Fixed<u16, B>> for Fixed<u16, B>
impl<const B: u32> BitOrAssign<Fixed<u16, B>> for Fixed<u16, B>
source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|=
operation. Read moresource§impl<const B: u32> BitOrAssign<Fixed<u32, B>> for Fixed<u32, B>
impl<const B: u32> BitOrAssign<Fixed<u32, B>> for Fixed<u32, B>
source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|=
operation. Read moresource§impl<const B: u32> BitOrAssign<Fixed<u8, B>> for Fixed<u8, B>
impl<const B: u32> BitOrAssign<Fixed<u8, B>> for Fixed<u8, B>
source§fn bitor_assign(&mut self, rhs: Self)
fn bitor_assign(&mut self, rhs: Self)
Performs the
|=
operation. Read moresource§impl<const B: u32> BitXorAssign<Fixed<i16, B>> for Fixed<i16, B>
impl<const B: u32> BitXorAssign<Fixed<i16, B>> for Fixed<i16, B>
source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
Performs the
^=
operation. Read moresource§impl<const B: u32> BitXorAssign<Fixed<i32, B>> for Fixed<i32, B>
impl<const B: u32> BitXorAssign<Fixed<i32, B>> for Fixed<i32, B>
source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
Performs the
^=
operation. Read moresource§impl<const B: u32> BitXorAssign<Fixed<i8, B>> for Fixed<i8, B>
impl<const B: u32> BitXorAssign<Fixed<i8, B>> for Fixed<i8, B>
source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
Performs the
^=
operation. Read moresource§impl<const B: u32> BitXorAssign<Fixed<u16, B>> for Fixed<u16, B>
impl<const B: u32> BitXorAssign<Fixed<u16, B>> for Fixed<u16, B>
source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
Performs the
^=
operation. Read moresource§impl<const B: u32> BitXorAssign<Fixed<u32, B>> for Fixed<u32, B>
impl<const B: u32> BitXorAssign<Fixed<u32, B>> for Fixed<u32, B>
source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
Performs the
^=
operation. Read moresource§impl<const B: u32> BitXorAssign<Fixed<u8, B>> for Fixed<u8, B>
impl<const B: u32> BitXorAssign<Fixed<u8, B>> for Fixed<u8, B>
source§fn bitxor_assign(&mut self, rhs: Self)
fn bitxor_assign(&mut self, rhs: Self)
Performs the
^=
operation. Read moresource§impl<const B: u32> DivAssign<Fixed<i16, B>> for Fixed<i16, B>
impl<const B: u32> DivAssign<Fixed<i16, B>> for Fixed<i16, B>
source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/=
operation. Read moresource§impl<const B: u32> DivAssign<Fixed<i32, B>> for Fixed<i32, B>
impl<const B: u32> DivAssign<Fixed<i32, B>> for Fixed<i32, B>
source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/=
operation. Read moresource§impl<const B: u32> DivAssign<Fixed<i8, B>> for Fixed<i8, B>
impl<const B: u32> DivAssign<Fixed<i8, B>> for Fixed<i8, B>
source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/=
operation. Read moresource§impl<const B: u32> DivAssign<Fixed<u16, B>> for Fixed<u16, B>
impl<const B: u32> DivAssign<Fixed<u16, B>> for Fixed<u16, B>
source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/=
operation. Read moresource§impl<const B: u32> DivAssign<Fixed<u32, B>> for Fixed<u32, B>
impl<const B: u32> DivAssign<Fixed<u32, B>> for Fixed<u32, B>
source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/=
operation. Read moresource§impl<const B: u32> DivAssign<Fixed<u8, B>> for Fixed<u8, B>
impl<const B: u32> DivAssign<Fixed<u8, B>> for Fixed<u8, B>
source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
Performs the
/=
operation. Read moresource§impl<const B: u32> MulAssign<Fixed<i16, B>> for Fixed<i16, B>
impl<const B: u32> MulAssign<Fixed<i16, B>> for Fixed<i16, B>
source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*=
operation. Read moresource§impl<const B: u32> MulAssign<Fixed<i32, B>> for Fixed<i32, B>
impl<const B: u32> MulAssign<Fixed<i32, B>> for Fixed<i32, B>
source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*=
operation. Read moresource§impl<const B: u32> MulAssign<Fixed<i8, B>> for Fixed<i8, B>
impl<const B: u32> MulAssign<Fixed<i8, B>> for Fixed<i8, B>
source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*=
operation. Read moresource§impl<const B: u32> MulAssign<Fixed<u16, B>> for Fixed<u16, B>
impl<const B: u32> MulAssign<Fixed<u16, B>> for Fixed<u16, B>
source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*=
operation. Read moresource§impl<const B: u32> MulAssign<Fixed<u32, B>> for Fixed<u32, B>
impl<const B: u32> MulAssign<Fixed<u32, B>> for Fixed<u32, B>
source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*=
operation. Read moresource§impl<const B: u32> MulAssign<Fixed<u8, B>> for Fixed<u8, B>
impl<const B: u32> MulAssign<Fixed<u8, B>> for Fixed<u8, B>
source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*=
operation. Read moresource§impl<I: Ord, const B: u32> Ord for Fixed<I, B>
impl<I: Ord, const B: u32> Ord for Fixed<I, B>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<I: PartialEq, const B: u32> PartialEq<Fixed<I, B>> for Fixed<I, B>
impl<I: PartialEq, const B: u32> PartialEq<Fixed<I, B>> for Fixed<I, B>
source§impl<I: PartialOrd, const B: u32> PartialOrd<Fixed<I, B>> for Fixed<I, B>
impl<I: PartialOrd, const B: u32> PartialOrd<Fixed<I, B>> for Fixed<I, B>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<const B: u32> RemAssign<Fixed<i16, B>> for Fixed<i16, B>
impl<const B: u32> RemAssign<Fixed<i16, B>> for Fixed<i16, B>
source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
Performs the
%=
operation. Read moresource§impl<const B: u32> RemAssign<Fixed<i32, B>> for Fixed<i32, B>
impl<const B: u32> RemAssign<Fixed<i32, B>> for Fixed<i32, B>
source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
Performs the
%=
operation. Read moresource§impl<const B: u32> RemAssign<Fixed<i8, B>> for Fixed<i8, B>
impl<const B: u32> RemAssign<Fixed<i8, B>> for Fixed<i8, B>
source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
Performs the
%=
operation. Read moresource§impl<const B: u32> RemAssign<Fixed<u16, B>> for Fixed<u16, B>
impl<const B: u32> RemAssign<Fixed<u16, B>> for Fixed<u16, B>
source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
Performs the
%=
operation. Read moresource§impl<const B: u32> RemAssign<Fixed<u32, B>> for Fixed<u32, B>
impl<const B: u32> RemAssign<Fixed<u32, B>> for Fixed<u32, B>
source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
Performs the
%=
operation. Read moresource§impl<const B: u32> RemAssign<Fixed<u8, B>> for Fixed<u8, B>
impl<const B: u32> RemAssign<Fixed<u8, B>> for Fixed<u8, B>
source§fn rem_assign(&mut self, rhs: Self)
fn rem_assign(&mut self, rhs: Self)
Performs the
%=
operation. Read moresource§impl<const B: u32> ShlAssign<u32> for Fixed<i16, B>
impl<const B: u32> ShlAssign<u32> for Fixed<i16, B>
source§fn shl_assign(&mut self, rhs: u32)
fn shl_assign(&mut self, rhs: u32)
Performs the
<<=
operation. Read moresource§impl<const B: u32> ShlAssign<u32> for Fixed<i32, B>
impl<const B: u32> ShlAssign<u32> for Fixed<i32, B>
source§fn shl_assign(&mut self, rhs: u32)
fn shl_assign(&mut self, rhs: u32)
Performs the
<<=
operation. Read moresource§impl<const B: u32> ShlAssign<u32> for Fixed<i8, B>
impl<const B: u32> ShlAssign<u32> for Fixed<i8, B>
source§fn shl_assign(&mut self, rhs: u32)
fn shl_assign(&mut self, rhs: u32)
Performs the
<<=
operation. Read moresource§impl<const B: u32> ShlAssign<u32> for Fixed<u16, B>
impl<const B: u32> ShlAssign<u32> for Fixed<u16, B>
source§fn shl_assign(&mut self, rhs: u32)
fn shl_assign(&mut self, rhs: u32)
Performs the
<<=
operation. Read moresource§impl<const B: u32> ShlAssign<u32> for Fixed<u32, B>
impl<const B: u32> ShlAssign<u32> for Fixed<u32, B>
source§fn shl_assign(&mut self, rhs: u32)
fn shl_assign(&mut self, rhs: u32)
Performs the
<<=
operation. Read moresource§impl<const B: u32> ShlAssign<u32> for Fixed<u8, B>
impl<const B: u32> ShlAssign<u32> for Fixed<u8, B>
source§fn shl_assign(&mut self, rhs: u32)
fn shl_assign(&mut self, rhs: u32)
Performs the
<<=
operation. Read moresource§impl<const B: u32> ShrAssign<u32> for Fixed<i16, B>
impl<const B: u32> ShrAssign<u32> for Fixed<i16, B>
source§fn shr_assign(&mut self, rhs: u32)
fn shr_assign(&mut self, rhs: u32)
Performs the
>>=
operation. Read moresource§impl<const B: u32> ShrAssign<u32> for Fixed<i32, B>
impl<const B: u32> ShrAssign<u32> for Fixed<i32, B>
source§fn shr_assign(&mut self, rhs: u32)
fn shr_assign(&mut self, rhs: u32)
Performs the
>>=
operation. Read moresource§impl<const B: u32> ShrAssign<u32> for Fixed<i8, B>
impl<const B: u32> ShrAssign<u32> for Fixed<i8, B>
source§fn shr_assign(&mut self, rhs: u32)
fn shr_assign(&mut self, rhs: u32)
Performs the
>>=
operation. Read moresource§impl<const B: u32> ShrAssign<u32> for Fixed<u16, B>
impl<const B: u32> ShrAssign<u32> for Fixed<u16, B>
source§fn shr_assign(&mut self, rhs: u32)
fn shr_assign(&mut self, rhs: u32)
Performs the
>>=
operation. Read moresource§impl<const B: u32> ShrAssign<u32> for Fixed<u32, B>
impl<const B: u32> ShrAssign<u32> for Fixed<u32, B>
source§fn shr_assign(&mut self, rhs: u32)
fn shr_assign(&mut self, rhs: u32)
Performs the
>>=
operation. Read moresource§impl<const B: u32> ShrAssign<u32> for Fixed<u8, B>
impl<const B: u32> ShrAssign<u32> for Fixed<u8, B>
source§fn shr_assign(&mut self, rhs: u32)
fn shr_assign(&mut self, rhs: u32)
Performs the
>>=
operation. Read moresource§impl<const B: u32> SubAssign<Fixed<i16, B>> for Fixed<i16, B>
impl<const B: u32> SubAssign<Fixed<i16, B>> for Fixed<i16, B>
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moresource§impl<const B: u32> SubAssign<Fixed<i32, B>> for Fixed<i32, B>
impl<const B: u32> SubAssign<Fixed<i32, B>> for Fixed<i32, B>
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moresource§impl<const B: u32> SubAssign<Fixed<i8, B>> for Fixed<i8, B>
impl<const B: u32> SubAssign<Fixed<i8, B>> for Fixed<i8, B>
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moresource§impl<const B: u32> SubAssign<Fixed<u16, B>> for Fixed<u16, B>
impl<const B: u32> SubAssign<Fixed<u16, B>> for Fixed<u16, B>
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moresource§impl<const B: u32> SubAssign<Fixed<u32, B>> for Fixed<u32, B>
impl<const B: u32> SubAssign<Fixed<u32, B>> for Fixed<u32, B>
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read moresource§impl<const B: u32> SubAssign<Fixed<u8, B>> for Fixed<u8, B>
impl<const B: u32> SubAssign<Fixed<u8, B>> for Fixed<u8, B>
source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
Performs the
-=
operation. Read more