I'm totally stuck with a math problem and though I should ask the list=20 for help as a last resort I need to calculate the dew point in C using integer maths. The dew=20 point can be calculated with the following expression logEw =3D ( 0.66077 + ( ( 7.5 * T ) / (237.3 + T ) ) + ( log10(RH) - 2 = ) dp =3D ( (0.66077 - logEw ) * 237.3 ) / ( logEw - 8.16077 ) which is derived from EW =3D 10^ ( 0.66077+(7.5*T/ (237.3+T)) ) // this is the saturation=20 vapor pressure over water. EW_RH =3D EW * RH / 100 // multiply with=20 relative humidity Dp =3D ((0.66077-log10(EW_RH))*237.3) / (log10(EW_RH)-8.16077) // this i= s=20 the dewpoint My usual approach to this is to try to make everything in the expression=20 integers so I end up with a result that is a number of factors bigger=20 than the actual and that way preserving decimals. But in this case an=20 long is to small for such an approach. I can get the ( log10(RH) - 2 ) expression from a table. My input values for T and RH is t =3D 100*T and rh =3D 100 * RH that is b= oth=20 is preserved with two decimals. Any suggestions appreciated.... Regards /Ake --=20 --- Ake Hedman (YAP - Yet Another Programmer) eurosource, Brattbergav=E4gen 17, 820 50 LOS, Sweden Phone: (46) 657 413430 Cellular: (46) 73 84 84 102 Company home: http://www.eurosource.se =20 Kryddor/Te/Kaffe: http://www.brattberg.com Personal homepage: http://www.eurosource.se/akhe Automated home: http://www.vscp.org -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body