rational-compare: Rational Number Comparisons

Description Usage Arguments Examples

Description

Rational Number Comparisons

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## 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)

Arguments

e1

rational numbers, integers, or numerics

e2

rational numbers, integers, or numerics

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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))

bertcarnell/rational documentation built on May 10, 2021, 8:32 p.m.