try(isSigned(NULL)) # an error if 'x' does not represent numbers
L <- sapply(c(if (getRversion() >= "4.5") "raw", # for as(NULL, "raw")
"logical", "integer", "double", "complex",
"ulong", "slong", "fmpz", "fmpq", "mag", "arf", "acf",
"arb", "acb"),
as, object = NULL, simplify = FALSE)
F <- function (x) c(isSigned = isSigned (x),
isComplex = isComplex (x),
isFloating = isFloating(x))
t(vapply(L, F, logical(3L)))
Run the code above in your browser using DataLab