mpc-utils: mpc - Utilities for Getting Precision, Version, etc

Description Usage Arguments Value See Also Examples

Description

This page documents utilities from package mpc.

Usage

1
2
3
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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()

mpc documentation built on May 2, 2019, 5:25 p.m.