View previous topic :: View next topic |
Author |
Message |
acp693
Joined: 04 Sep 2006 Posts: 56
|
Posted: Tue Jun 26, 2007 8:04 pm Post subject: passing double to single |
|
|
Hello,
My program curve fits data in double precision, and later the results are displayed as graphs using the simple plot library. My problem is that I have an intermittent fault when passing the double precision array for plotting to a single precision array accepted by Simpleplot. The values are normalised to be within the single precision range before passing to the single precision array, however I intermittently receive a floating point overflow error. I don't understand why it only happens intermittently as I'm testing with the same data each time.
How do I pass the values from my double precision array to the single precision array?
Best regards
Albert |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Tue Jun 26, 2007 9:27 pm Post subject: |
|
|
1. Is there a SimplePlot routine that will take double precision values?
2. If you have to convert to single precision then copy into a single precision array before the call.
3. Have you tested your program using /CHECKMATE? |
|
Back to top |
|
|
acp693
Joined: 04 Sep 2006 Posts: 56
|
Posted: Wed Jun 27, 2007 8:38 am Post subject: |
|
|
Hello Paul,
I don't think any of the Simple plot routines that I am using take double precision. the routine used is VSZU.
I am already passing my double precision arrays to a single precision array by using:
singlearray = sngl(doublearray)
The values in doublearray are normalised so that they lie within single precision limits.
I haven't checked with Checkmate, as the part of my code which does the curve fitting, uses calls to the acml library which somehow checkmate objects to, and the code will not run. the calls to acml work alright in release mode. I will have to seperate the graphing part of the code to be able to run checkmate.
best regards
Albert |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7928 Location: Salford, UK
|
Posted: Wed Jun 27, 2007 12:02 pm Post subject: |
|
|
If you cannot use /CHECKMATE can you use /CHECK or just /DEBUG?
If you start up your program with SDBG it should stop and show you the line where the overflow occurs. |
|
Back to top |
|
|
|