[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::decc_bugs

Title:DEC C Problem Reporting Forum
Notice:Report DEC C++ problems in TURRIS::C_PLUS_PLUS
Moderator:CXXC::REPETETCHEON
Created:Fri Nov 13 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1299
Total number of notes:6249

1270.0. "printf problems with big numbers, again 7.1 AXP 5.5-002 C" by COMICS::EDWARDSN (Dulce et decorum est pro PDP program) Tue Mar 11 1997 10:23

This is with VMS 7.1 and DEC C 5.5-002 DECC$SHR "X07.1-3"

The following program:

#include <stdio.h>
void main (void)
{
  double n1;
  for (n1=9.0e16; n1 < 11.0e17; n1+=1.0e+17) printf ("%20.0f\n", n1);
}


generates the following spurious output
   90000000000000000
  19000000000000000
  29000000000000000
  39000000000000000
  49000000000000000
  59000000000000000
  69000000000000000
  79000000000000000
  89000000000000000
  99000000000000000
 1090000000000000000

i.e. for some reason, when you're in a certain range of numbers it has a tendency
to strip the last 0.

This problem exists with the ALPACRT05_062 and ALPACRT03_070, I shall be trying it with 
ALPACRT08_062 shortly, just to check. I don't have a 7.0 AXp so I'll have to leave that
one with you, but I feel that the problem will probably exist there too since it
is still alive and well on 7.1

So fundamentally, and I'll put this through an escalation if necessary, 
I need fixes for 6.2 and 7.0 and 7.1 DEC C shareables.

I'll look out for further correspondance,

thanks for listening,

Neil.


P.S. the following also seems to demonstrate the behaviour.

#include <stdio.h>
void main (void)
{
  double n1 =  99999360000000000.0;
  double n2 = 100000224000000000.0;
  printf ("%020.0f\n", n1);
  printf ("%020.0f\n", n2);

}

T.RTitleUserPersonal
Name
DateLines
1270.1Produces expected results on Digital UNIX V4.0DECC::SULLIVANJeff SullivanTue Mar 11 1997 11:4118
Using DEC C V5.2-033 on Digital UNIX V4.0, I see these results:

% cc decc_bugs1270.c ; a.out
   90000000000000000
  190000000000000000
  290000000000000000
  390000000000000000
  490000000000000000
  590000000000000000
  690000000000000000
  790000000000000000
  890000000000000000
  990000000000000000
 1090000000000000000

I would suspect that this is a VMS RTL issue.

-Jeff
1270.2TLE::D_SMITHDuane Smith -- DEC C RTLTue Mar 11 1997 12:356
    The problem is reproducible and is being tracked as CRTL problem number
    1697.  We will post updates as the work progresses.  Our analysis shows
    that the problem did not exist in OpenVMS V6.1, but does exist in all 
    later releases.
    
    Duane