AnsweredAssumed Answered

VRF - VEE double

Question asked by VRFuser on Feb 5, 1996
From:           "Ondrej Valter" <valter@feld.cvut.cz>
    To:             VRf
    Date sent:      6 Feb 1996  1300  MET-1
    Subject:       No proper function of double in VEE

Hello,
   I would like to ask you for help in solving the below mentioned
problems with double in HP VEE product.
   I'm creating DLL for Windows 3.1 by Microsoft C 7.00. There are no
problems with creating the DLL (I follow the recomendations for
compiler and linker options described in HP Product Note 2120-3(HP
VEE for Windows) ). The problems occur during the running DLL with
double under the VEE. I have a HP VEE version 3.1 and 3.12 release on
2.2.95 and 7.7.95 respectively.
   Almost nothing is possible in the case of using double as a
parametr of function (called both by value and by reference). There
are 2 types of errors:

a) General Protection Fault in vee.exe or in *.dll in the programs
like these:

long FAR CDECL Zkouska(double FAR *data)
{
   double *pom;

*pom=*data;
*data=2*(*pom);     // GENERAL PROTECTION FAULT ('GPF') in .dll
    {   return ((long)0);}
}


double FAR CDECL Zkouska(double data)
{
   double dd;

dd=data/2;

   { return(dd);} // GPF in VEE.EXE
}


long FAR CDECL Zkouska(double FAR *data)
{
double *pom;

  *pom=20.;

if((*data) > (double)(*pom))  // GPF !
  { return((long)10);}
else
  { return((long)1);}

}

b) Returning the constant value independent on the result   
   of function:  

long FAR CDECL Zkouska(double FAR *data)
{
{
  *data = (double) ((*data)+1.);  
}
  { return((long)0);}
}
  // returns *data=4419.3424 e249, for subtraction -4419...



long FAR CDECL Zkouska(double FAR *data)
{
   double pom;

pom=*data;
pom /=2;    
*data=pom; 
{return ((long)0);}
}

// returns multiples of 4419.. acording to the *data value assigned
in VEE  


On the other side this function works properly:


long FAR CDECL Zkouska(double FAR *data)
{
  *data=(double)(1/(*data)); 
  return((long) 0);
}


    The demonstrated examples prove there is something wrong in
treatment of double in HP VEE. If you want, send me please your
experience with using of double in VEE and ,if you know, the
recomendation how to overcome above mentioned problems.

My email address is:
valter@feld.cvut.cz

     Thank you and best regards
      
           Ondrej Valter
          

Outcomes