MCPcopy Create free account
hub / github.com/StudyRust/leetcode_rust / divide

Method divide

29-divide-two-integers.rs:6–12  ·  view source on GitHub ↗
(dividend: i32, divisor: i32)

Source from the content-addressed store, hash-verified

4
5impl Solution {
6 pub fn divide(dividend: i32, divisor: i32) -> i32 {
7 if dividend == -2147483648 && divisor == -1 {
8 2147483647
9 } else {
10 dividend / divisor
11 }
12 }
13}
14
15fn main() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected