Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.os2.programmer.misc > #1283

infinity with double, crashes with redirected output

From "A.D. Fundum" <what.ever@neverm.ind>
Message-ID <o8uYFJ3iqTdG-pn2-feJB6lPjeHl7@localhost> (permalink)
Newsgroups comp.os.os2.programmer.misc
Subject infinity with double, crashes with redirected output
Organization Xennanews
Date 2013-10-01 00:06 +0200

Show all headers | View raw


What's needed to avoid that all printf("%9.2lf\n"); output becomes 
"infinity"?

I'm trying to calculate so-called ICB sector ROIs, a.o. weighted by 
turnover. It works for Q1 2013 upto and including Q3 2013, but fails 
with e.g. Q4 2012 upto and including Q3 2013. Output (failure, Q4 
2012-Q3 2013) sample:

9533  Computer Services                                7  infinity  
infinity
9535  Internet                                         1  infinity  
infinity
9537  Software                                         7  infinity  
infinity
9576  Semiconductors                                   2  infinity  
infinity
9578  Telecommunications Equipment                     5  infinity  
infinity


Please note I don't know what "infinity" really means, technically. 
Data used is checked and "should" be fine, but not every division is 
checked before it's executed. Reducing the turnover didn't help. 
Output sample without failure (Q1 2013-Q3 2013):

9533  Computer Services                                8     16.84    
 9.85
9535  Internet                                         1    -42.61    
-42.61
9537  Software                                         8      3.18    
25.37
9576  Semiconductors                                   4     39.88    
52.10
9578  Telecommunications Equipment                     5     21.38    
41.08


Probably a problem related to "infity", because it doesn't fail with 
Q1 2013-Q3 2013 but fails with Q4 2012-Q3 2013: why does an app crash 
with a SYS3178 (DIV/0) when STDIO is redirected to a (new) file, but 
not when the output isn't redirected? The displayed output 
(translated):

[Q:\data]sectors 20120928 20130930
Scanning Q:\Data\2012.PRN...
Scanning Q:\Data\2013.PRN...
Number of listings with an ICB-sector at 20120928: 201
Busy processing Q:\Data\2012.PRN...
Busy processing Q:\Data\2013.PRN...
SECTORS.PRN created.
sectors.html created.


Same, but with redirected output:

[Q:\data]sectors 20120928 20130930 > file.txt
Exception = c0000095 occurred at EIP = 11f5b.
SYS1808:
The process has stopped.  The software diagnostic
code (exception code) is  0095.

09-30-2013  23:48:12  SYS3178  PID 09ae  TID 0001  Slot 0085
Q:\DATA\SECTORS.EXE
c0000095
00011f5b
EAX=000b0020  EBX=00000160  ECX=00000049  EDX=0003009c
ESI=00000000  EDI=000b0020  
DS=0053  DSACC=f0f3  DSLIM=ffffffff  
ES=0053  ESACC=f0f3  ESLIM=ffffffff  
FS=150b  FSACC=00f3  FSLIM=00000030
GS=0000  GSACC=****  GSLIM=********
CS:EIP=005b:00011f5b  CSACC=f0df  CSLIM=ffffffff
SS:ESP=0053:0004c330  SSACC=f0f3  SSLIM=ffffffff
EBP=0004c818  FLG=00002206

SECTORS.EXE 0001:00001f5b


--

Back to comp.os.os2.programmer.misc | Previous | NextNext in thread | Find similar


Thread

infinity with double, crashes with redirected output "A.D. Fundum" <what.ever@neverm.ind> - 2013-10-01 00:06 +0200
  Re: infinity with double, crashes with redirected output Lars Erdmann <lars.erdmann@arcor.de> - 2013-10-01 07:44 +0200
  Re: infinity with double, crashes with redirected output "Ruediger Ihle" <NOSPAM$R_Ihle@S-t.De> - 2013-10-01 06:24 +0000
    Re: infinity with double, crashes with redirected output Dave Yeo <dave.r.yeo@gmail.com> - 2013-10-01 08:00 -0700
    Re: infinity with double, crashes with redirected output Lars Erdmann <lars.erdmann@arcor.de> - 2013-10-02 08:03 +0200
      Re: infinity with double, crashes with redirected output "A.D. Fundum" <what.ever@neverm.ind> - 2013-10-09 16:58 +0200
        Re: infinity with double, crashes with redirected output Lars Erdmann <lars.erdmann@arcor.de> - 2013-10-10 07:15 +0200
          Re: infinity with double, crashes with redirected output - correction Lars Erdmann <lars.erdmann@arcor.de> - 2013-10-10 07:31 +0200
          Re: infinity with double, crashes with redirected output "A.D. Fundum" <what.ever@neverm.ind> - 2013-10-10 18:44 +0200

csiph-web