Page 1 of 1

Error Calculation in fwh 64-bits

PostPosted: Sat May 20, 2017 1:50 pm
by Mulyadi
Hi All..

I have a problem with calculation like this:

? ( 2.29 * 7000 ) // = 16030
? ( 2.30 * 7000 ) // = ******* = 1.61000000000000E4

this sample is litle case,
and so many combine value in a variable return wrong result.

this problem just in FWH 64-bits version, on 32-bit version is okay.

Code: Select all  Expand view

#include "fivewin.ch"

function Main()

   local ar := {}
     
   ar := { { 2.29, 7000, 0 }, ;
        { 2.30, 7000, 0 } }                      

   ? ( 2.29 * 7000 )        // = 16030
   ? ( 2.30 * 7000 )        // = *******  = 1.61000000000000E4
   
   aEval( aR, {|e| e[3] := e[1] * e[2] })
       
   Browse1( aR )
   
   return nil


    function Browse1( uSource )

       local oDlg, oBar, oFont, oBrw
       local bRowCalc

       DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
       DEFINE DIALOG oDlg SIZE 400,500 PIXEL TRUEPIXEL FONT oFont

       DEFINE BUTTONBAR oBar OF oDlg SIZE 80,32 2015

       @ 50,20 XBROWSE oBrw SIZE -20,-20 PIXEL OF oDlg ;
          DATASOURCE uSource AUTOCOLS ;
          headers "Qty", "Price", "Totals" ;
          pictures "999,999.99", "999,999,999.99", "999,999,999,999.99" ;
          COLSIZES 60, 90, 130  ;
          CELL LINES NOBORDER FOOTERS FASTEDIT

       bRowCalc := { || oBrw:Totals:Value := oBrw:Qty:Value * oBrw:Price:Value }

       WITH OBJECT oBrw
                   
          WITH OBJECT oBrw:Qty
             :nEditType := EDIT_GET
             :bOnChange := bRowCalc
          END
          WITH OBJECT oBrw:Price
             :nEditType := EDIT_GET
             :bOnChange := bRowCalc            
             :cFooter   := "Total..."
          END
                   
     :Totals:nFooterType  := AGGR_SUM
          :lHScroll      := .f.

          :MakeTotals()
          :CreateFromCode()
         
       END
       DEFINE BUTTON OF oBar PROMPT "Close"   CENTER ACTION oDlg:End()

       ACTIVATE DIALOG oDlg CENTERED
       RELEASE FONT oFont

    return nil
 

Re: Error Calculation in fwh 64-bits

PostPosted: Sun May 21, 2017 5:07 am
by Antonio Linares
Mulyadi,

It seems as a Harbour bug related to BCC 64 bits.

If built with Visual Studio 64 bits, then it is ok:

build64.bat mulyadi
Image

Re: Error Calculation in fwh 64-bits

PostPosted: Sun May 21, 2017 9:31 am
by Mulyadi
Thanks mr Antonio.

I will try and hope to next time Harbour/xHarbour get ready to run in 64 bits too.

Best regards,

Re: Error Calculation in fwh 64-bits

PostPosted: Sun May 21, 2017 10:43 am
by Antonio Linares
We are going to test it using bcc 73 64 bits, to check if it is a Harbour or a BCC issue

Re: Error Calculation in fwh 64-bits

PostPosted: Mon Jun 19, 2017 2:52 am
by Mulyadi
Halo All friends, any news about this topic...? :)