Hello, am I working with the library FpuLibx 2.1, but do I have a problem when subtracting two numbers with the function FpuSub, is a presicion error, the result apparently returned by the function it is similar to the first one operating of this, to solve this problem I have made a small function that modifies the control word, specifically the field R, establishing this at 11b, but when using this result for example in the function FpuFLtoA this it returns me a chain that doesn't correspond with the number that it should return, does it influence this result in the result, for example, of the function FpuFLtoA?
Posted on 2009-07-05 19:15:13 by xdad
We may be in a much better position to help if you post the code you used to call those library functions.
Posted on 2009-07-05 23:42:02 by Raymond
hello Roymond, here this the code, greetings

invoke FpuAtoFL,chr$("1.409607519723014E+0024"),ADDR Op1,SRC1_REAL or DEST_MEM
.if eax==0
print chr$(" --Error in FpuAtoFL.",13,10)
return 0
.endif

invoke FpuSub,ADDR Op1,256,ADDR Result,SRC1_REAL or SRC2_DIMM or DEST_MEM
.if eax==0
print chr$(" --Error in FpuSub.",13,10)
return 0
.endif

invoke FpuComp,ADDR Op1,ADDR Result,SRC1_REAL or SRC2_REAL
.if eax==0
print chr$(" --Error in FpuComp.",13,10)
return 0
.endif

.if eax==CMP_EQU
print chr$(" --EQU.",13,10)
return 0
.elseif eax==CMP_GREATER
print chr$(" --GREATER.",13,10)
return 0
.elseif eax==CMP_LOWER
print chr$(" --LOWER.",13,10)
return 0
.endif
Posted on 2009-07-06 16:27:43 by xdad
Have a quick look at the description of the format of floating point numbers at the following:
http://www.ray.masmcode.com/tutorial/fpuchap2.htm#floats

You should then realize that the most precision expected from the floating point format (when using extended double precision, i.e. REAL10, i.e. 80 bits) is the equivalent of 19 decimal digits.

Thus, trying to subtract a 3-digit number (256) from a 24-digit number (1.409607519723014E+0024) will not have any effect on the most significant 19 digits.

Do not hesitate to ask if you need more information.

N.B. The FpuAtoFL function requires only one flag to specify the destination. Fortunately, the SRC1_REAL could not have any adverse effect on the outcome of this function.
Posted on 2009-07-06 23:20:57 by Raymond