Newsgroups : Borland : borland.public.delphi.rtl.win32 : 2006 Feb : Weird(?) Invalid floating point operation Exception

www.cryer.info
Managed Newsgroup Archive

Weird(?) Invalid floating point operation Exception

Subject:Weird(?) Invalid floating point operation Exception
Posted by:"ShaneF" (shane.fit..@worldsmartretech.com.au)
Date:Thu, 9 Feb 2006 09:30:07

Hi all,
ONe of our programs is raising an EInvalidOp exception. It occurs on a line
of code that calls a ethod (which accepts, amongst others, 3 doubles). I
have included a code snippet below,...this has stumped all of us here & any
assistance greatly appreciated

Exception details:
Disc :0Norm:0LPG :0<End>


Exception 'EInvalidOp' in module WinPOSt.exe at 00006747

Invalid floating point operation.

Source file: UNKNOWN, Line UNKNOWN


Call stack:

System..FSafeDivide

I_recalc.TReCalc.Recalculate (I_Recalc.pas, line 287)

TfrmWinPOStParent.ReCalcSubTotal (WinPOStParent.pas, line 4960)


Code:

procedure TfrmWinPOStParent.ReCalcSubTotal;

begin

  if...

  else

    IReCalc.ReCalculate(true,0,0.0,0.0,0.0,'','',BHJrnCurr); //4960

procedure TReCalc.Recalculate(InSubTotal: boolean;

                              disc      : integer;

                              discRate         : double;

                              centsperlitreNorm: double;

                              CentsperLitreLPG : double;

                              Descript         : string;

                              store: String; CurrJrn: TBHJrnCurr);

begin

  ResetFinalPrice(CurrJrn);

  if frmMain.AllowOffers Then

    NewOfferSystemWinPOSt.CalculateOffers(CurrJrn, InSubTotal);

try

    IReductions.RecalculateReductions(InSubTotal,            //line 287

                                      disc,

                                      discRate,

                                      centsperlitreNorm,

                                      centsperlitreLPG,

                                      Descript,

                                      store,

                                      CurrJrn);

  Except  //source of comment in error log

    on E: EInvalidOp do

      logexceptionmsg('Disc :' + FloatToStrF(discRate,ffGeneral,15,30)

              +'Norm:' + FloatToStrF(centsperlitreNorm,ffGeneral,15,30)

              +'LPG :' + FloatToStrF(centsperlitreLPG,ffGeneral,15,30)

              +'<End>', E);

Replies:

www.cryer.info
Managed Newsgroup Archive