rational-compare | R Documentation |
Rational Number Comparisons
## S4 method for signature 'rationalS4,numeric'
Compare(e1, e2)
## S4 method for signature 'rationalS4,integer'
Compare(e1, e2)
## S4 method for signature 'numeric,rationalS4'
Compare(e1, e2)
## S4 method for signature 'integer,rationalS4'
Compare(e1, e2)
## S4 method for signature 'rationalS4,rationalS4'
Compare(e1, e2)
## S3 method for class 'rationalS3'
Ops(e1, e2)
## S3 method for class 'rationalR6'
Ops(e1, e2)
## S3 method for class ''rational::rationalS7''
Ops(e1, e2, ...)
e1 |
rational numbers, integers, or numerics |
e2 |
rational numbers, integers, or numerics |
... |
Additional arguments |
Dispatch happens in 3 steps
1. Ops.rational::rationalS7
2. S7_Ops generic
3. rationalS7 method for S7_Ops with the right signature
a <- rational(1L, 3L, "S3")
b <- rational(3L, 4L, "S3")
d <- 3L
e <- 20.1
stopifnot(a != b)
stopifnot(!(a == b))
stopifnot(a < b)
stopifnot(!(a > b))
stopifnot(a <= b)
stopifnot(!(a >= b))
stopifnot(a != d)
stopifnot(!(a == d))
stopifnot(a < d)
stopifnot(!(a > d))
stopifnot(a <= d)
stopifnot(!(a >= d))
stopifnot(a != e)
stopifnot(!(a == e))
stopifnot(a < e)
stopifnot(!(a > e))
stopifnot(a <= e)
stopifnot(!(a >= e))
a <- rational(1L, 3L, "R6")
b <- rational(3L, 4L, "R6")
d <- 3L
e <- 20.1
stopifnot(a != b)
stopifnot(!(a == b))
stopifnot(a < b)
stopifnot(!(a > b))
stopifnot(a <= b)
stopifnot(!(a >= b))
stopifnot(a != d)
stopifnot(!(a == d))
stopifnot(a < d)
stopifnot(!(a > d))
stopifnot(a <= d)
stopifnot(!(a >= d))
stopifnot(a != e)
stopifnot(!(a == e))
stopifnot(a < e)
stopifnot(!(a > e))
stopifnot(a <= e)
stopifnot(!(a >= e))
a <- rational(1L, 3L, "S7")
b <- rational(3L, 4L, "S7")
d <- 3L
e <- 20.1
stopifnot(a != b)
stopifnot(!(a == b))
stopifnot(a < b)
stopifnot(!(a > b))
stopifnot(a <= b)
stopifnot(!(a >= b))
stopifnot(a != d)
stopifnot(!(a == d))
stopifnot(a < d)
stopifnot(!(a > d))
stopifnot(a <= d)
stopifnot(!(a >= d))
stopifnot(a != e)
stopifnot(!(a == e))
stopifnot(a < e)
stopifnot(!(a > e))
stopifnot(a <= e)
stopifnot(!(a >= e))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.