Why different output from math expression nest in function vs. called directly?

Struct a weird effect in R. When coding a math expression as a function you get a different output than when coded directly? Any good explanations/solutions?

myfun <- function(x) x^(1/4)

myfun(-238194.65) returns: NaN

-238194.65^(1/4) returns: -22.0919



from Recent Questions - Stack Overflow https://ift.tt/3crKQQP
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

I get wrong characters when retreiving the message body of an email using TIdIMAP4.UIDRetrieveTextPeek2()

How to drop the all the 1's in a correlation matrix

Today Walkin 14th-Sept