mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
36 lines
693 B
Plaintext
36 lines
693 B
Plaintext
NAME
|
|
isrel - whether two values are relatively prime
|
|
|
|
SYNOPSIS
|
|
isrel(x, y)
|
|
|
|
TYPES
|
|
x int
|
|
y int
|
|
|
|
return int
|
|
|
|
DESCRIPTION
|
|
Determine if x and y are relatively prime. If gcd(x,y) == 1, then
|
|
return 1, otherwise return 0.
|
|
|
|
EXAMPLE
|
|
> print isrel(6, 5), isrel(5, 6), isrel(-5, 6)
|
|
1 1 1
|
|
|
|
> print isrel(6, 2), isrel(2, 6), isrel(-2, 6)
|
|
0 0 0
|
|
|
|
LIMITS
|
|
none
|
|
|
|
LIBRARY
|
|
BOOL zrelprime(ZVALUE x, y)
|
|
|
|
SEE ALSO
|
|
gcd,
|
|
isassoc, isatty, isblk, isconfig, isdefined, iserror, iseven, isfile,
|
|
ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobj,
|
|
isobjtype, isodd, isprime, isrand, israndom, isreal,
|
|
issimple, issq, isstr, istype
|