FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Error Calculation in fwh 64-bits
Posts: 85
Joined: Mon Apr 18, 2011 02:32 AM
Error Calculation in fwh 64-bits
Posted: Sat May 20, 2017 01:50 PM
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 (fw): Select all Collapse
#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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Error Calculation in fwh 64-bits
Posted: Sun May 21, 2017 05:07 AM
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
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 85
Joined: Mon Apr 18, 2011 02:32 AM
Re: Error Calculation in fwh 64-bits
Posted: Sun May 21, 2017 09:31 AM

Thanks mr Antonio.

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

Best regards,

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Error Calculation in fwh 64-bits
Posted: Sun May 21, 2017 10:43 AM

We are going to test it using bcc 73 64 bits, to check if it is a Harbour or a BCC issue

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 85
Joined: Mon Apr 18, 2011 02:32 AM
Re: Error Calculation in fwh 64-bits
Posted: Mon Jun 19, 2017 02:52 AM

Halo All friends, any news about this topic...? :)

Continue the discussion