検索

phrase: max: clip:
target: order:
Results of 1 - 4 of about 4 for division (0.010 sec.)
Option - Rust By Example 日本語版 11409
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... T の value をラップするタプルです。 // An integer division that doesn't `panic!` // `panic!`を起こさない整数の ... 割り算 fn checked_division(dividend: i32, divisor: i32) -> Option<i32> { if d ... dividend / divisor) } } // This function handles a division that may not succeed // この関数は失敗する割り算を ... 扱うことができる fn try_division(dividend: i32, divisor: i32) { // `Option` values ...
https://man.plustar.jp/rust/example/std/option.html - [similar]
panic! - Rust By Example 日本語版 10725
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... 示させ、exitします。 // Re-implementation of integer division (/) // 整数の除法(/)の再実装 fn division(dividend: ... i32, divisor: i32) -> i32 { if divisor == 0 { // Division by zero triggers a panic // ゼロによる除算はパニッ ... クを引き起こす panic!("division by zero"); } else { dividend / divisor } } // The ... re // このオペレーションはタスクの失敗を引き起こす division(3, 0); println!("This point won't be reached!"); / ...
https://man.plustar.jp/rust/example/std/panic.html - [similar]
? - Rust By Example 日本語版 7452
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... n. mod checked { #[derive(Debug)] enum MathError { DivisionByZero, NonPositiveLogarithm, NegativeSquareRoot, } ... f64) -> MathResult { if y == 0.0 { Err(MathError::DivisionByZero) } else { Ok(x / y) } } fn sqrt(x: f64) -> M ... y: f64) -> MathResult { // if `div` "fails", then `DivisionByZero` will be `return`ed let ratio = div(x, y)?; ... => "logarithm of non-positive number", MathError::DivisionByZero => "division by zero", MathError::NegativeSq ...
https://man.plustar.jp/rust/example/std/result/question_mark.html - [similar]
Documentation testing - Rust By Example 日本語版 7341
Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2. ... ero. /// /// ```rust,should_panic /// // panics on division by zero /// doccomments::div(10, 0); /// ``` pub f ...
https://man.plustar.jp/rust/example/testing/doc_testing.html - [similar]
PREV 1 NEXT