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