% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compare.R
\name{mt_duration-compare}
\alias{mt_duration-compare}
\alias{==,mt_duration-method}
\alias{!=,mt_duration-method}
\alias{<,mt_duration-method}
\alias{<=,mt_duration-method}
\alias{>,mt_duration-method}
\alias{>=,mt_duration-method}
\title{Comparison operators for durations (\code{mt_duration})}
\usage{
\S4method{==}{mt_duration}(e1, e2)
\S4method{!=}{mt_duration}(e1, e2)
\S4method{<}{mt_duration}(e1, e2)
\S4method{<=}{mt_duration}(e1, e2)
\S4method{>}{mt_duration}(e1, e2)
\S4method{>=}{mt_duration}(e1, e2)
}
\arguments{
\item{e1, e2}{\code{mt_duration} vectors (or values castable to one, such as plain
numeric vectors interpreted in the other operand's chronon).}
}
\value{
A logical vector.
}
\description{
A duration is a scalar magnitude of time measured in a given chronon (e.g.
\code{days(3)}), with no reference to a point in time. Comparing two durations is
therefore a plain magnitude comparison, once both operands have been
expressed in a common chronon:
\itemize{
\item \code{a == b} iff the two magnitudes are equal in their common chronon
\item \code{a < b}, \code{a <= b}, \code{a > b}, \code{a >= b} compare the magnitudes directly
}

Unlike \code{mt_linear} comparison there is no interval/span to consider, so this
\emph{is} a total order. When both operands already share a chronon the magnitudes
are compared as-is; otherwise both are scaled to their finest common chronon
(the same scaling used when combining durations arithmetically, see
\code{duration_combine()}).
}
