Learn R Programming

DnE (version 1.0)

sqrt1: sqrt1

Description

calculate the evolution of real number

Usage

sqrt1(x)

Arguments

x
real number

Value

  • the evolution of the number

Details

this function is used to solve the square root of a complex number or a real number

References

the function includes some other functions which have been exsisted in R

See Also

DnE-package

Examples

Run this code
require(stats)
a <- -2
sqrt1(a)
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (x) 
{
    if (x >= 0) {
        x = sqrt(x)
    }
    else {
        x = complex(real = 0, imaginary = sqrt(-x))
    }
  }

Run the code above in your browser using DataLab