Learn R Programming

cyclotomic (version 1.3.0)

cycSqrt: Square root as a cyclotomic number

Description

Square root of an integer or a rational number as a cyclotomic number. This is slow.

Usage

cycSqrt(x)

Value

The square root of x as a cyclotomic number.

Arguments

x

an integer, a gmp rational number (bigq object), or a fraction given as a string (e.g. "5/3")

Examples

Run this code
cycSqrt(2)
phi <- (1 + cycSqrt(5)) / 2 # the golden ratio
phi^2 - phi # should be 1

Run the code above in your browser using DataLab