Error Calculation in fwh 64-bits

Error Calculation in fwh 64-bits

Postby Mulyadi » Sat May 20, 2017 1: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: Select all  Expand view  RUN

#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
 
User avatar
Mulyadi
 
Posts: 82
Joined: Mon Apr 18, 2011 2:32 am

Re: Error Calculation in fwh 64-bits

Postby Antonio Linares » Sun May 21, 2017 5: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
Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42127
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Error Calculation in fwh 64-bits

Postby Mulyadi » Sun May 21, 2017 9: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,
User avatar
Mulyadi
 
Posts: 82
Joined: Mon Apr 18, 2011 2:32 am

Re: Error Calculation in fwh 64-bits

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42127
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Error Calculation in fwh 64-bits

Postby Mulyadi » Mon Jun 19, 2017 2:52 am

Halo All friends, any news about this topic...? :)
User avatar
Mulyadi
 
Posts: 82
Joined: Mon Apr 18, 2011 2:32 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 38 guests