divisor_25 {exams.forge} | R Documentation |
Number Properties
Description
-
is_terminal
checks whetherx
's can be expressed as a terminal fraction, basicallydivisor_25(denominator(x))
-
divisor_25
checks whether allx
's can be expressed as2^x 5^y
-
prime_numbers
returns all prime numbers up to a limit -
primes
prime factorization ofx
, returns a matrix with the power of each prime number -
has_digits
checks whether thex
's have onlydigits
after the decimal point, basicallyabs(x-round(x, digits))<tol
-
all_integer
checks whether allx
's are integer, basicallyall(has_digits(x,0))
Usage
divisor_25(x)
denominator_25(x)
is_terminal(x)
round_25(x)
prime_numbers(n, sieve = FALSE)
primes(x, min = 2)
has_digits(
x,
digits = 2,
tol = 10^{
-digits - 6
}
)
all_integer(x)
only_digits(
x,
digits = 2,
tol = 10^{
-digits - 6
}
)
is_term(x)
denom_25(x)
Arguments
x |
numeric: values to test/check |
n |
integer: find all prime numbers up to n |
sieve |
logical: should in any case the Sieve of Eratosthenes be used to compute prime numbers (default: |
min |
integer: the minimum prime number used (default: |
digits |
numeric: number of digits to check (default: |
tol |
numeric: max. deviation from the rounded |
Value
logical
Examples
is_terminal(2/3) # 0.6666... non-terminal
is_terminal(1/5) # 0.2 terminal
divisor_25(1:25)
prime_numbers(100) # all prime numbers less equal 100
primes(1:20) # prime factorization of 1 to twenty