|
| View previous topic :: View next topic |
| Author |
Message |
khea_actua1
Joined: 06 Nov 2008 Posts: 42 Location: Carleton University
|
Posted: Wed Mar 14, 2012 4:30 pm Post subject: 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,
| Code: |
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,
| Code: |
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,
| Code: |
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. |
|
| Back to top |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 5001 Location: The Portland Group Inc.
|
Posted: Fri Mar 16, 2012 11:09 am Post subject: |
|
|
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: | Code: |
subroutine mypow(x, y)
double precision x
double precision y
print *, x**y
end |
- Mat |
|
| Back to top |
|
 |
khea_actua1
Joined: 06 Nov 2008 Posts: 42 Location: Carleton University
|
Posted: Fri Mar 16, 2012 1:08 pm Post subject: |
|
|
| hmm, good idea. I'll try it out. Thanks! |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group
|