Search Results

Search found 3 results on 1 pages for 'biga'.

Page 1/1 | 1 

  • Can piping of screen to file change the result of a C++ code?

    - by Biga
    I am having this very weird behaviour with a C++ code: It gives me different results when running with and without piping the screen to a file (reproducible in cygwin and linux). I mean, if I get the same executable and run it like './run' or run it like './run out.log', I get different results! I use std::cout to output to screen, all lines ending with endl; I use ifstream for the input file; I use ofstream for output, all lines ending with endl. I am using g++ 4. Any idea what is going on? UPDATE: I have hard-coded the input data, so 'ifstream' is not used, and problem persists. UPDATE 2: That's getting interesting. I have output three variables that are computed initially, and that's what I get with and without piping direct to screen: 0 -0.02 0 piped: 0 -0.02 1.04083e-17 So there's a round-off difference with and without piping the output! Now, why piping would interefere with an internal computation of the code?

    Read the article

  • Can redirection of screen output to file change the result of a C++ code?

    - by Biga
    I am having this very weird behaviour with a C++ code: It gives me different results when running with and without redirecting the screen output to a file (reproducible in cygwin and linux). I mean, if I get the same executable and run it like ./run or run it like ./run >out.log, I get different results! I use std::cout to output to screen, all lines ending with endl; I use ifstream for the input file; I use ofstream for output, all lines ending with endl. I am using g++ 4. Any idea what is going on? UPDATE: I have hard-coded the input data, so 'ifstream' is not used, and problem persists. UPDATE 2: That's getting interesting. I have probed three variables that are computed initially, and that's what I get when using with and without redirecting the output to file redirected to file: 0 -0.02 0 direct to screen: 0 -0.02 1.04083e-17 So there's a round-off difference in the code variables with and without redirecting the output! Now, why redirecting would interefere with an internal computation of the code? UPDATE 3: If I redirect to /dev/null, I get the sam behaviour as outputing direct to screen, instead of redirecting to file.

    Read the article

  • Can nohup change the result of a C++ code?

    - by Biga
    I am having this very weird behaviour with a C++ code: It gives me different results when running with and without 'nohup' (reproducible in cygwin and linux). I mean, if I get the same executable and run it like './run' or run it like 'nohup ./run out.log', I get different results! I use std::cout to output to screen, all lines ending with endl; I use ifstream for the input file; I use ofstream for output, all lines ending with endl. I am using g++ 4. Any idea what is going on?

    Read the article

1