[Math Sqrt] Timing Problem ???

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Reiner Apke

    #1

    [Math Sqrt] Timing Problem ???

    Hello,

    I have got a very strange problem with the calcualtion of the the square
    root (Math.Sqrt()).

    I calculate in a loop a lot of of diameters

    maxDiameter = Math.Sqrt(maxCr ossSection * 4.00 / Math.PI);
    minDiameter = Math.Sqrt(minCr ossSection * 4.00 / Math.PI);


    In my Visual Studio .NET development environment I get in the Debug and
    the Release version the right results. If install my application and
    test
    the same functionallity the results are different to the results out of
    my development environment.
    How can that be ??

    I' m doing further tests on this behaviour and implement for testing an
    MessageBox after the calculation of the diameters, now I get in the
    debug
    version, the release version and in my installed version the correct
    results.

    Is there a timing problem for the Math.Sqrt() function ???

    At the moment I' making a Thread.Sleep(0) after the calculation of the
    diameters and everything is working fine


    Best regards
    Reiner


  • Atmapuri

    #2
    Re: [Math Sqrt] Timing Problem ???

    Hi!

    Most probably your variables are not properly initialized.
    Maybe you assumed zero somewhere and when you debug
    it is zero at that location in the memory, but its not there
    when you are running the app.
    --
    Atmapuri

    "Reiner Apke" <R.Apke@gmx.d e> wrote in message
    news:3F6FEA4F.A EB9B6B5@gmx.de. ..[color=blue]
    > Hello,
    >
    > I have got a very strange problem with the calcualtion of the the square
    > root (Math.Sqrt()).
    >
    > I calculate in a loop a lot of of diameters
    >
    > maxDiameter = Math.Sqrt(maxCr ossSection * 4.00 / Math.PI);
    > minDiameter = Math.Sqrt(minCr ossSection * 4.00 / Math.PI);
    >
    >
    > In my Visual Studio .NET development environment I get in the Debug and
    > the Release version the right results. If install my application and
    > test
    > the same functionallity the results are different to the results out of
    > my development environment.
    > How can that be ??
    >
    > I' m doing further tests on this behaviour and implement for testing an
    > MessageBox after the calculation of the diameters, now I get in the
    > debug
    > version, the release version and in my installed version the correct
    > results.
    >
    > Is there a timing problem for the Math.Sqrt() function ???
    >
    > At the moment I' making a Thread.Sleep(0) after the calculation of the
    > diameters and everything is working fine
    >
    >
    > Best regards
    > Reiner
    >
    >[/color]


    Comment

    Working...