gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
1617 Posts in 535 Topics by 779 Members - Latest Member: rhoronjeff@comcast.net November 27, 2022, 08:44:28 PM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Absoft User Forum  |  Support  |  General  |  Why is 1.0+0.25*spacing(1.0) not rounded to 1.0?
gfx
gfxgfx
 

Author Topic: Why is 1.0+0.25*spacing(1.0) not rounded to 1.0?  (Read 3657 times)

kengo

  • Newbie
  • *
  • Posts: 6
Why is 1.0+0.25*spacing(1.0) not rounded to 1.0?
« on: August 11, 2011, 07:34:01 PM »
Why is 1.0+0.25*spacing(1.0) not rounded to 1.0?
This is observed only in quadruple precision.
I use Absoft Pro FORTRAN 11.1 on OSX10.7Lion.
« Last Edit: August 11, 2011, 08:22:33 PM by kengo »

Mike Linacre

  • Sr. Member
  • ****
  • Posts: 259
Re: Why is 1.0+0.25*spacing(1.0) not rounded to 1.0?
« Reply #1 on: August 12, 2011, 08:13:44 PM »
Kengo, ouch! Your results indicate that something has been converted to double-precision floating point ....

1. How about displaying the expressions: 1.0_16, 0.25_16, spacing(1.0_16), 0.25_16*spacing(1.0_16) to verify that the intermediate computations are what we expect?

2. How about stepping through the Absoft debugger's assembler code? This may reveal where there are unexpected numerical conversions.

kengo

  • Newbie
  • *
  • Posts: 6
Re: Why is 1.0+0.25*spacing(1.0) not rounded to 1.0?
« Reply #2 on: August 13, 2011, 12:02:40 PM »
Mike,
Thank you for your replying.

1.0_16, 0.25_16, spacing(1.0_16) and 0.25_16*spacing(1.0_16) seem to be correct.
1.0_16+0.25_16*spacing(1.0_16), however, seems to be incorrect.

I have attached a screen shot.
I think the fourth of the Value field of e16 must be 0x00000000.
It is equal to the second of d16.

There may be something wrong in procedures for exponent bits.
« Last Edit: August 14, 2011, 05:22:37 AM by kengo »

kengo

  • Newbie
  • *
  • Posts: 6
Re: Why is 1.0+0.25*spacing(1.0) not rounded to 1.0?
« Reply #3 on: August 13, 2011, 12:25:03 PM »
I have attached the second screenshot showing the assembler code.

e16 in the previous message by me is likely calculated between MAIN__+330 and MAIN__+429 in this screenshot.

I haven't determined the cause of the problem.
« Last Edit: August 14, 2011, 05:23:17 AM by kengo »

Absoft User Forum  |  Support  |  General  |  Why is 1.0+0.25*spacing(1.0) not rounded to 1.0?
 

gfxgfx
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!