pub fn new(minus: bool, numerator: RationalUnit, denominator: RationalUnit) -> Option<Self> {
        if denominator != 0 {
            Some(unsafe { Self::new_unchecked(minus, numerator, denominator) })
        } else {
            None
        }
    }
/// Makes a new rational number.
///
/// The return number is simplify fraction.
///
/// # Examples
///
/// ```
/// use lib_rust::math::rational::Rational;
///
/// // It means `-1/19`.
/// let num = Rational::new(true, 3, 57);
/// let num2 = Rational::new(true, 1, 19);
/// assert_eq!(num, num2);
///
/// let num = num.unwrap();
/// assert_eq!(num, -3.0/57.0);
/// assert_eq!(num, -1.0/19.0);
/// // Rational can compare with int tuple.
/// assert_eq!(num, (3, -57));
/// assert_eq!(num, (-1, 19));
///
/// // The denominator cannot be zero.
/// assert_eq!(Rational::new(false, 1, 0), None);
/// ```
Makes a new rational number.
The return number is simplify fraction.
Makes a new rational number . The return number is simplify fraction .
pub fn new(minus: bool, numerator: RationalUnit, denominator: RationalUnit) -> Option<Self> {
        if denominator != 0 {
            Some(unsafe { Self::new_unchecked(minus, numerator, denominator) })
        } else {
            None
        }
    }
pub fn new ( minus : bool , numerator : RationalUnit , denominator : RationalUnit ) -> Option < Self > { if denominator != 0 { Some ( unsafe { Self :: new_unchecked ( minus , numerator , denominator ) } ) } else { None } }
Makes a new rational number.
Makes a new rational number .
minus
bool
numerator
RationalUnit
denominator
RationalUnit
minus
bool
numerator
RationalUnit
denominator
RationalUnit
examples
```
use lib_rust::math::rational::Rational.



let num = num.unwrap();
assert_eq!(num, -3.0/57.0);
assert_eq!(num, -1.0/19.0);
Rational can compare with int tuple.

The denominator cannot be zero.
` ` ` use lib_rust :: math :: rational :: Rational . let num = num . unwrap () ; assert_eq! ( num - 3 . 0 / 57 . 0 ) ; assert_eq! ( num - 1 . 0 / 19 . 0 ) ; Rational can compare with int tuple . The denominator cannot be zero .