From 2451d359175e5e7bc9ff98904cc4f626e19af779 Mon Sep 17 00:00:00 2001 From: Enyium <123484196+Enyium@users.noreply.github.com> Date: Sat, 11 Feb 2023 05:12:30 +0100 Subject: [PATCH] Improved documentation. - `Ratio` now specifies exact cases when converting to it yields `None`. --- src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 431ddd5..dfb4387 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -45,7 +45,12 @@ use num_traits::{ mod pow; -/// Represents the ratio between two numbers. +/// Represents the ratio between two integers. +/// +/// Converting to a `Ratio` yields `None` in the following cases: +/// +/// - The input value is out of the bounds of the integer target type, which, in case of a float, includes positive and negative infinity. +/// - The input value is a float and NaN. #[derive(Copy, Clone, Debug)] #[allow(missing_docs)] pub struct Ratio {