|
[Sponsors] |
[Fortran] (-real number)**(- or + real number) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 13, 2007, 16:17 |
[Fortran] (-real number)**(- or + real number)
|
#1 |
Guest
Posts: n/a
|
I am computing a switch to choose a criteria depending on a value. In doing it, I need to compute a value like below
(-real number)**(- or + real number).. so I used the usual syntax "**" to consider the power as the pow in c++. But it gave me a NaN value. Please let me know how to treat such a power in fortran. Thanks in advance. |
|
June 13, 2007, 16:46 |
Re: [Fortran] (-real number)**(- or + real number)
|
#2 |
Guest
Posts: n/a
|
The problem is occurred when I tried to compute following
-0.24987**0.3846 --> it's okay but when I tried to use r**GammaK --> it cause NaN Of course, r is a value containing -0.24978 and Gammak has something. |
|
June 14, 2007, 03:27 |
Re: [Fortran] (-real number)**(- or + real number)
|
#3 |
Guest
Posts: n/a
|
1) -0.24987**0.3846 is evaluated as -(0.24987**0.3846) because of the operator precedence in Fortran
2) r**GammaK is not a real number for r<0 and GammaK real. Check your formulas! |
|
June 14, 2007, 15:50 |
Re: [Fortran] (-real number)**(- or + real number)
|
#4 |
Guest
Posts: n/a
|
Thanks. You're right. It's a complex number.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] Number of cells in mesh don't match with size of cellLevel | colinB | OpenFOAM Meshing & Mesh Conversion | 14 | December 12, 2018 09:07 |
Standard k-eps with UDF/UDS | andreas_haakansson | FLUENT | 0 | November 26, 2010 10:08 |
[snappyHexMesh] snappyHexMesh aborting | Tobi | OpenFOAM Meshing & Mesh Conversion | 0 | November 10, 2010 04:23 |
UDF for Heat Exchanger model | francois louw | FLUENT | 2 | July 16, 2010 03:21 |
Unaligned accesses on IA64 | andre | OpenFOAM | 5 | June 23, 2008 11:37 |