MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / checked_div

Method checked_div

crates/wasmtime/src/runtime/vm/byte_count.rs:133–137  ·  view source on GitHub ↗

Divide an aligned byte count by another aligned byte count, producing a scalar value. Returns an error in case the divisor is zero.

(self, divisor: HostAlignedByteCount)

Source from the content-addressed store, hash-verified

131 ///
132 /// Returns an error in case the divisor is zero.
133 pub fn checked_div(self, divisor: HostAlignedByteCount) -> Result<usize, ByteCountOutOfBounds> {
134 self.0
135 .checked_div(divisor.0)
136 .ok_or_else(|| ByteCountOutOfBounds(ByteCountOutOfBoundsKind::Div))
137 }
138
139 /// Compute the remainder of an aligned byte count divided by another
140 /// aligned byte count.

Callers 5

xdiv32_sMethod · 0.80
xdiv64_sMethod · 0.80
xdiv32_uMethod · 0.80
xdiv64_uMethod · 0.80
calculateFunction · 0.80

Calls 1

Tested by

no test coverage detected