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

  • Home
  • SEARCH
  • 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 7515803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:55:40+00:00 2026-05-30T00:55:40+00:00

I have a code with possible floating point overflows which cannot be managed by

  • 0

I have a code with possible floating point overflows which cannot be managed by checking arguments of functions. I have to define _matherr and throw an exception from inside it in order to give a chance to caller to manage the problem.

There is something strange: in Debug build, _matherr is called as supposed, but not in Release. I use CodeGear C++ Builder 2007. Under MSVC 2010 the handler works fine, but I need VCL features for the whole application. Googling gives nothing but messages about _matherr not working in DLL (that is known from documentation).

And my question is: what could be the reason for _matherr to not work in Release?

// One of the methods with overflows.
double DoubleExponential::F(double x) const
{
    try
    {
        double y=pow(fabs(x),a);
        return 0.5 + sign(x)*G(y,1/a)/(2*G(1/a));
    }
    catch(PowExpOverflow)
    {
        return 0.5;
    }
}

// Exception.
struct PowExpOverflow {};

int _matherr (struct _exception *a){
    Application->MessageBox("Inside custom _matherr", "", MB_OK);
    if (a->type == OVERFLOW)
        if (!strcmp(a->name,"pow") ||
            !strcmp(a->name,"powl") ||
            !strcmp(a->name,"exp") ||
            !strcmp(a->name,"expl"))
        {
            throw PowExpOverflow();
        }
    return 0;
}
  • 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-30T00:55:43+00:00Added an answer on May 30, 2026 at 12:55 am

    The problem is due to bug in the dynamic RTL which I use in the release build (description). The bug was not fixed in the version of IDE I use, so the only working solution is to upgrade to a higher version. Nevertheless, having a clear explanation helps a lot.

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

Sidebar

Related Questions

Possible Duplicate: Floating point comparison I have some simple C code and the output
I have the following code which I use to match fancybox possible elements: $('a.grouped_elements').each(function(){
I have the following PHP code which works out the possible combinations from a
Possible Duplicates: Is JavaScript's Math broken? Java floating point arithmetic I have the current
Possible Duplicate: Why is floating point arithmetic in C# imprecise? I have been dealing
In particular, would it be possible to have code similar to this c++ code
Okay, of course it is possible, that's no issue. In my code I have
Is it possible to have the router return an error code (or an entire
Anyone have any thoughts on how/if it is possible to integrate Google Code commits
Possible Duplicate: Graph visualization code in javascript? I have to integrate a graph with

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.