universal_constants 0.0.1

Physical and mathematical constants that are generally considered to be universally constant.
Documentation
use approx::assert_relative_eq;
use universal_constants::conversions::time;

const ABS_TOL: f64 = 1e-12;
const REL_TOL: f64 = 1e-13;

#[test]
fn convert_days_to_hours() {
    let test: f64 = 50.0 * time::DAYS_TO_HOURS;
    let truth: f64 = 1200.0;
    assert_relative_eq!(test, truth, epsilon = ABS_TOL, max_relative = REL_TOL);
}

#[test]
fn convert_days_to_minutes() {
    let test: f64 = 50.0 * time::DAYS_TO_MINUTES;
    let truth: f64 = 72000.0;
    assert_relative_eq!(test, truth, epsilon = ABS_TOL, max_relative = REL_TOL);
}

#[test]
fn convert_days_to_seconds() {
    let test: f64 = 50.0 * time::DAYS_TO_SECONDS;
    let truth: f64 = 4.32E6;
    assert_relative_eq!(test, truth, epsilon = ABS_TOL, max_relative = REL_TOL);
}

#[test]
fn convert_hours_to_days() {
    let test: f64 = 50.0 * time::HOURS_TO_DAYS;
    let truth: f64 = 2.08333333333333;
    assert_relative_eq!(test, truth, epsilon = ABS_TOL, max_relative = REL_TOL);
}

#[test]
fn convert_hours_to_seconds() {
    let test: f64 = 50.0 * time::HOURS_TO_SECONDS;
    let truth: f64 = 180000.0;
    assert_relative_eq!(test, truth, epsilon = ABS_TOL, max_relative = REL_TOL);
}

#[test]
fn convert_hours_to_minutes() {
    let test: f64 = 50.0 * time::HOURS_TO_MINUTES;
    let truth: f64 = 3000.0;
    assert_relative_eq!(test, truth, epsilon = ABS_TOL, max_relative = REL_TOL);
}

#[test]
fn convert_minutes_to_days() {
    let test: f64 = 50.0 * time::MINUTES_TO_DAYS;
    let truth: f64 = 0.03472222222222222;
    assert_relative_eq!(test, truth, epsilon = ABS_TOL, max_relative = REL_TOL);
}

#[test]
fn convert_minutes_to_hours() {
    let test: f64 = 50.0 * time::MINUTES_TO_HOURS;
    let truth: f64 = 0.8333333333333333;
    assert_relative_eq!(test, truth, epsilon = ABS_TOL, max_relative = REL_TOL);
}

#[test]
fn convert_minutes_to_seconds() {
    let test: f64 = 50.0 * time::MINUTES_TO_SECONDS;
    let truth: f64 = 3000.0;
    assert_relative_eq!(test, truth, epsilon = ABS_TOL, max_relative = REL_TOL);
}

#[test]
fn convert_seconds_to_days() {
    let test: f64 = 50.0 * time::SECONDS_TO_DAYS;
    let truth: f64 = 0.0005787037037037037;
    assert_relative_eq!(test, truth, epsilon = ABS_TOL, max_relative = REL_TOL);
}

#[test]
fn convert_seconds_to_hours() {
    let test: f64 = 50.0 * time::SECONDS_TO_HOURS;
    let truth: f64 = 0.01388888888888888;
    assert_relative_eq!(test, truth, epsilon = ABS_TOL, max_relative = REL_TOL);
}

#[test]
fn convert_seconds_to_minutes() {
    let test: f64 = 50.0 * time::SECONDS_TO_MINUTES;
    let truth: f64 = 0.8333333333333333;
    assert_relative_eq!(test, truth, epsilon = ABS_TOL, max_relative = REL_TOL);
}