Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4343674
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:47:14+00:00 2026-05-21T11:47:14+00:00

I am experiencing an unexpected behaviour and was hoping someone could help with some

  • 0

I am experiencing an unexpected behaviour and was hoping someone could help with some guidance as to what areas to focus an investigation on.

I have two methods, one essentially performs a divide by zero test on a double, the second calls an extern method for an unmanaged dll.

Note: In the .Net runtime, dividing a Double by Zero should return an Infinity value (amusingly of either positive or negative flavours).

Pseudocode for what I am doing looks something like this:

InfinityTest(); // Returns an Infinity value as expected
DllCall();
InfinityTest(); // Divide by zero error on second call.

The first call to InfinityTest() returns the value Infinity as expected. The second call to InfinityTest() throws a Divide by Zero exception that I didn’t expect.

Update

The effective InfinityTest() code below. For brevity I’ve removed try/catch elements, etc. I do not have permission to go into details about the DllCall() pseudocode element, apologies.

private double InfinityTest()
{
    double a = 1.0;
    int b = 0;
    return a / b;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T11:47:15+00:00Added an answer on May 21, 2026 at 11:47 am

    Since it sounds like your DLL is changing the FP status word on you, your only choice may be to change it back. I would suggest P/Invoke to _clearfp or _fpreset. Here are their P/Invoke signatures:

        [DllImport("msvcrt.dll")]
        static extern UInt32 _clearfp();
        [DllImport("msvcrt.dll")]
        static extern void _fpreset();
    

    This may not reset things back to exactly the way they were, but hopefully it will be close enough.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am experiencing some unexpected behavior. I have added a custom filed of Rating
Using the json module in python 2.6, I'm experiencing some unexpected behavior when passing
ASP.Net MVC 3 RC, Razor Experiencing some unexpected behavior when I try to use
I have the following class in a Windows Service that is experiencing some vary
I am developing a Spring/Hibernate application and I am seeing some unexpected behaviour whilst
Lately our customers are experiencing unexpected crashes. We are already logging the errors on
Our team has been experiencing a recurring problem with velocity templates. Upon rendering, some
Im experiencing some lag when I create a Web Application Starter Project when it
After experiencing some performances issues on my client side, we decided to give a
I'm experiencing a strange behaviour when looking via reflection for annotations on a method

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.