Calculating Exponents in the Debugger

Hey,

This might be a dumb question… but how might I calculate exponents in the debugger?

When I try say, 2**3, I get an error as that operator is not recognized, so I tried the C style way,

pgdbg [all] 0> print pow(2,3)
WARNING: Function pow is not compiled using -g

[0] Assuming 'long' return type.
1

I tried making it a real,

pgdbg [all] 0> print pow(2.0,3.0)
WARNING: Function pow is not compiled using -g

[0] Assuming 'long' return type.
1

Then tried printf,

pgdbg [all] 0> printf "%0.5f,%d",pow(2.3,4),3
WARNING: Function pow is not compiled using -g

[0] Assuming 'long' return type.
,3

No luck…

I ask because I’m trying to follow some calculations in the code in the debugger, and they have a bunch of exponents in them.

Hi khea_actua1,

While pgdbg does support several command line operations, pow is not one of them. As a work around you could add your own routine in your program and then call the routine from the pgdbg command prompt. Something like:

       subroutine mypow(x, y)
           double precision x
           double precision y
           print *, x**y
       end
  • Mat

hmm, good idea. I’ll try it out. Thanks!