Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!orion.oac.uci.edu!biivax.dp.beckman.com!dn71!a_rubin From: a_rubin@dsg4.dse.beckman.com Newsgroups: comp.os.msdos.programmer Subject: Re: TC vs mainframe Keywords: tc Message-ID: Date: 13 May 91 16:11:20 GMT References: <127293@unix.cis.pitt.edu> Lines: 21 Nntp-Posting-Host: dn71.dse.beckman.com In <127293@unix.cis.pitt.edu> yding@unix.cis.pitt.edu (Yijun Ding ) writes: >Recently I have a program with small floatings. I find something works >on my TC but not on mainframe. The following code, log10() print >correctly on TC2.0. It is HUGE on unix, and 0 on VMS in University of >Pittsburgh. That is a surprise. >#include >main() >{ > double a=1.12345e-40; > printf("%lf %lf\n", a, log10(a)); >} >Any one can explain why? I don't know about UNIX, but in VMS, 1.12345e-40 is calculated as a float, rather than a double; hence it is 0. (log10(0) is 0? THAT is a bug.) -- a_rubin@dsg4.dse.beckman.com My opinions are my own, and do not represent those of my employer.