Is it possible the value you're seeing in the debugger is from a prior loop 
iteration?  I would try stepping through 1 or 2 more lines and rechecking the 
value of ANS.  It's been my experience that the current line of source code 
reported by the debugger and the current line of object code being executed can 
sometimes be slightly off.

You might also try ANS = SDIV(TOP.VALUE, BOTTOM.VALUE, 9) to see if you get a 
different result.

-John

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org 
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Shawn Hayes
Sent: Friday, June 18, 2010 1:26 PM
To: u2-users@listserver.u2ug.org
Subject: [U2] Division Issues

Hello,

I ran into an issue when dividing 2 numbers.  I debugged through the first 
program and here is the result...
TEST1:  27:      IF LOAD.VALUE THEN
:: S
TEST1:  28:          ANS = TOP.VALUE/BOTTOM.VALUE
::S

::TOP.VALUE/
NUMBER: 0.399999999
:: BOTTOM.VALUE/
NUMBER: 0.006554707
:: ANS/
NUMBER: 61.02484472

I created a little test program to divide the same 2 numbers and I came up with 
this...
TEST.DIV:  3: NUM1 = 0.399999999
:: S
TEST.DIV:  4: NUM2 = 0.006554707
:: S
TEST.DIV:  5: PRINT NUM1/NUM2
:: S
61.024848098

As you can see 61.024848098 does not equal 61.02484472?   I have messed around 
with the PRESICION statement and I still have not gotten this to work?  Can 
someone advise?  Thanks!!!

 'We act as though comfort and luxury were the chief requirements of life, when 
all that we need to make us happy is something to be enthusiastic about.' 
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to