🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #6136

Re: TC vs mainframe

#6136
From: a_rubin
Date: Mon, 13 May 1991 16:11
21 lines
1101 bytes
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 <math.h>
>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.
Technical Details
Message-ID: <a_rubin.674151080@dn71>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!orion.oac.uci.edu!biivax.dp.beckman.com!dn71!a_rubin
References: <127293@unix.cis.pitt.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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: <a_rubin.674151080@dn71>
Date: 13 May 91 16:11:20 GMT
References: <127293@unix.cis.pitt.edu>
Lines: 21
Nntp-Posting-Host: dn71.dse.beckman.com