mpc-utils {mpc}R Documentation

mpc – Utilities for Getting Precision, Version, etc

Description

This page documents utilities from package mpc.

Usage

getPrec(z)
urandom.mpc(precision)
mpcVersion()

Arguments

z

An MPC object representing a complex number in arbitary precision floating point.

precision

The number of bits of precision that should be used to represent the returned complex number z.

Value

getPrec(z) returns a integer vector of length 2 where the first element contains the number of bits of precision of the real part of z and the second element contains the number of bits of precision of the imaginary part of z.

urandom.mpc(precision) returns a uniformly distributed random complex mpc object in the unit square [0,1]*[0,1].

mpcVersion returns the MPC library version as a string.

See Also

mpc.

Examples

library(mpc)

z1 <- mpc(3, 100)
getPrec(z1)  # 100 bits.

z2 <- mpc(3, 200)
getPrec(z2)  # 200 bits.

z3 <- z1 + z2
getPrec(z3)  # 200 bits

urandom.mpc(53)
urandom.mpc(53)

mpcVersion()

[Package mpc version 0.2 Index]