Raising a negative value to a fraction power?
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ahmed
el 24 de Nov. de 2020
Comentada: Ahmed
el 24 de Nov. de 2020
I am rasing a negative value to a fraction power. Depending on how I write the operation (putting the negative value in parenthesis or not), the answer changes (see below)? Am I missing something?
0 comentarios
Respuesta aceptada
Alan Stevens
el 24 de Nov. de 2020
Exponentiation has a higher priority than negation, so -2^1.2 is -(2^1.2), this results in a negative real. On the other had (-2)^1.2 raises a negative number to a fractional power, because parentheses take priority over exponentiation, and the result is a complex number.
Más respuestas (0)
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!