# [Fortran] (-real number)**(- or + real number)

 Register Blogs Members List Search Today's Posts Mark Forums Read

 June 13, 2007, 15:17 [Fortran] (-real number)**(- or + real number) #1 jinwon 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, 15:46 Re: [Fortran] (-real number)**(- or + real number) #2 jinwon 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, 02:27 Re: [Fortran] (-real number)**(- or + real number) #3 Markus Lummer 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, 14:50 Re: [Fortran] (-real number)**(- or + real number) #4 jinwon Guest   Posts: n/a Thanks. You're right. It's a complex number.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post colinB OpenFOAM Native Meshers: snappyHexMesh and Others 11 January 13, 2015 12:47 andreas_haakansson FLUENT 0 November 26, 2010 10:08 Tobi OpenFOAM Native Meshers: snappyHexMesh and Others 0 November 10, 2010 04:23 francois louw FLUENT 2 July 16, 2010 02:21 andre OpenFOAM 5 June 23, 2008 10:37

All times are GMT -4. The time now is 09:39.