Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

NegRationals

Set of Negative Rational Numbers


Description

The mathematical set of negative rational numbers, defined as the set of numbers that can be written as a fraction of two integers and are non-positive. i.e.

p/q : p,q ε Z, p/q ≤ 0, q != 0

where Z is the set of integers.

Details

The $contains method does not work for the set of Rationals as it is notoriously difficult/impossible to find an algorithm for determining if any given number is rational or not. Furthermore, computers must truncate all irrational numbers to rational numbers.

Super classes

Methods

Public methods


Method new()

Create a new NegRationals object.

Usage
NegRationals$new(zero = FALSE)
Arguments
zero

logical. If TRUE, zero is included in the set.

Returns

A new NegRationals object.


Method clone()

The objects of this class are cloneable with this method.

Usage
NegRationals$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also


set6

R6 Mathematical Sets Interface

v0.2.1
MIT + file LICENSE
Authors
Raphael Sonabend [aut, cre] (<https://orcid.org/0000-0001-9225-4654>), Franz Kiraly [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.