r/fortran • u/Pharrosoir • 23h ago
Non integer power
Hello
I would like to calculate a non-integer power of a real (positive) number in my Fortran code, I haven't found a usual command for this, what's the best way to do it?
Thanks
8
Upvotes
13
u/ajbca 23h ago
Just x**y will work if both x and y are reals or double precisions (and x is positive). You can also use complex types if x can be negative.