MCPcopy Index your code
hub / github.com/endbasic/endbasic / clamped_mul

Method clamped_mul

std/src/console/graphics.rs:91–94  ·  view source on GitHub ↗
(self, rhs: u16)

Source from the content-addressed store, hash-verified

89
90impl ClampedMul<u16, i16> for u16 {
91 fn clamped_mul(self, rhs: u16) -> i16 {
92 let product = u32::from(self) * u32::from(rhs);
93 if product > i16::MAX as u32 { i16::MAX } else { product as i16 }
94 }
95}
96
97impl ClampedMul<u16, u16> for u16 {

Callers 6

put_pixelsMethod · 0.80
draw_cursorMethod · 0.80
clear_cursorMethod · 0.80
open_lineMethod · 0.80
raw_write_wrappedMethod · 0.80
clearMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected