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

Today Walkin 14th-Sept

Hibernate Search - Elasticsearch with JSON manipulation

Spring Elasticsearch Operations