format-methods | R Documentation |
Format a flint
vector for pretty printing.
## S4 method for signature 'ulong'
format(x, base = 10L, ...)
## S4 method for signature 'slong'
format(x, base = 10L, ...)
## S4 method for signature 'fmpz'
format(x, base = 10L, ...)
## S4 method for signature 'fmpq'
format(x, base = 10L, ...)
## S4 method for signature 'mag'
format(x, base = 10L, digits = NULL, sep = NULL,
rnd = flintRnd(), ...)
## S4 method for signature 'arf'
format(x, base = 10L, digits = NULL, sep = NULL,
rnd = flintRnd(), ...)
## S4 method for signature 'acf'
format(x, base = 10L, digits = NULL, sep = NULL,
rnd = flintRnd(), ...)
## S4 method for signature 'arb'
format(x, base = 10L, digits = NULL, sep = NULL,
rnd = flintRnd(), ...)
## S4 method for signature 'acb'
format(x, base = 10L, digits = NULL, sep = NULL,
rnd = flintRnd(), ...)
x |
a |
base |
an integer from 2 to 62 indicating a base for output. Values 2, 10, and 16 correspond to binary, decimal, and hexadecimal output. Digits are represented by characters ‘[0-9A-Za-z]’, in that significance order, hence the maximum 10+26+26=62. |
digits |
an integer indicating how many digits of the significand are
reported when formatting floating type vectors. When more than one
digit is printed, a radix point inserted after the first digit.
Value 0 is equivalent to the minimum integer |
sep |
a nonempty character string used to separate the significand from
the exponent. The default value |
rnd |
a nonempty character string whose first character indicates a
rounding mode. Methods for |
... |
further optional arguments, though these are currently unused. |
A character vector containing ASCII strings of equal length.
q <- .fmpq(num = c(-1L, 1L) * 0:5, den = 1:6)
for (b in 2:8) {
cat("base = ", b, ":\n", sep = "")
print(format(q, base = b), quote = FALSE, width = 12L)
}
z <- .acb(real = .arb(mid = pi, rad = 0.5 * pi))
format(z)
format(z, base = 62L, sep = "*[62]^")
strsplit(format(Re(z), digits = 80L), "[( )]")[[1L]][c(FALSE, TRUE)]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.