Learn R Programming

distr6 (version 1.3.2)

PosRationals: Set of Positive Rationals

Description

The mathematical set of positive rational numbers.

Value

Returns R6 object of class PosRationals.

Constructor

PosRationals$new(dim = 1, zero = FALSE)

Constructor Arguments

Argument Type Details
dim numeric Dimension of the set.
zero = FALSE logical If TRUE, zero is included in the set.

Details

The set of Positive Rationals is defined as the set of numbers that can be written as a fraction of two integers and are non-negative, i.e. $$PosRationals = \{\frac{p}{q} | p,q \ \in \ Z, \ \frac{p}{q} \ge 0\}$$ where \(Z\) is the set of integers.

\(0\) may or may not be included (depending on the zero argument).

See Also

listSpecialSets

Examples

Run this code
# NOT RUN {
PosRationals$new()
PosRationals$new(zero = TRUE)
PosRationals$new(dim = 2)

# }

Run the code above in your browser using DataLab