mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
38 lines
701 B
Plaintext
38 lines
701 B
Plaintext
NAME
|
|
issq - whether a value is a square
|
|
|
|
SYNOPSIS
|
|
issq(x)
|
|
|
|
TYPES
|
|
x real
|
|
|
|
return int
|
|
|
|
DESCRIPTION
|
|
Determine if x is a square. If there exists integers a, b such that:
|
|
|
|
x == a^2 / b^2 (b != 0)
|
|
|
|
return 1, otherwise return 0.
|
|
|
|
EXAMPLE
|
|
> print issq(25), issq(3), issq(0)
|
|
1 0 1
|
|
|
|
> print issq(4/25), issq(-4/25), issq(pi())
|
|
1 0 0
|
|
|
|
LIMITS
|
|
none
|
|
|
|
LIBRARY
|
|
BOOL qissquare(NUMBER *x)
|
|
BOOL zissquare(ZVALUE x)
|
|
|
|
SEE ALSO
|
|
isassoc, isatty, isblk, isconfig, isdefined, iserror, iseven, isfile,
|
|
ishash, isident, isint, islist, ismat, ismult, isnull, isnum, isobj,
|
|
isobjtype, isodd, isprime, isrand, israndom, isreal, isrel,
|
|
issimple, isstr, istype
|