473,385 Members | 1,317 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Graceful error recovery with arithmetic

Hi there,
I'm having trouble making some code do a "graceful" recovery for
mathematical operations. Certain functions e.g. log10, will call
"matherr" and provides an avenue for intervention in a result.

How can I do the same in a portable fashion for arithmetic operations?
For example, catching dividing by zero using scalars (int's,doubles
etc.)?

Is there a standard way of getting C++ to throw some kind of
std::exception when a math-error results? Is there any standard
implementations for this somewhere?

Thanks,
Martin

Aug 4 '05 #1
1 1330
mmacrobert wrote:
I'm having trouble making some code do a "graceful" recovery for
mathematical operations. Certain functions e.g. log10, will call
"matherr" and provides an avenue for intervention in a result.

How can I do the same in a portable fashion for arithmetic operations?
You can't. The only portable way is to _prevent_ it instead of _dealing_
with it when it's happened.
[..]

Aug 4 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jacob H | last post by:
Hello all, I'm nearing the completion of my first graphical console game and my thoughts have turned to the subject of gracefully handling runtime errors. During development I like to not handle...
5
by: Udy | last post by:
Hi, We have a custom application used by a customer on DB2 8.1.5 AIX 5.1, we have tested it with 8.1.0 AIX 5.1 and everything works fine. But with 8.1.5 we get the above error. The other...
5
by: NG | last post by:
Hi, We are having DB2-V7.2 DB on AIX 5.2 machine. Recently we upgraded our system to fixpack 13 and activated activate AIX asynchronous IO function. Our DB is going to crash recovery with...
74
by: lovecreatesbeauty | last post by:
My small function works, but I have some questions. And I want to listen to you on How it is implemented? 1. The function does not check if parameter x is larger or smaller than parameter y. ...
6
by: p175 | last post by:
2006-08-14-17.46.13.656000-240 I1472H436 LEVEL: Warning PID : 1452 TID : 336 PROC : db2syscs.exe INSTANCE: DB2 NODE : 000 DB : SQ4V6...
3
by: danceli | last post by:
"The log file for database is full. Back up the transaction log for the database to free up some log space." Now I only know this way to deal with that manually, Step1. in option , chance...
3
by: jer006 | last post by:
Hi I am writing a select statement that has an arithmetic function inside a case statement that uses logic to decide whether to divide or multiply and when I run the arithmetic statements outside...
0
by: pavankumarveera | last post by:
how to unblock the CF below error what was the solution. GES: Potential blocker (pid=282) on resource CF-00000000-00000000; enqueue info in file...
0
by: Winder | last post by:
Computer Data Recovery Help 24/7 Data recovering tools and services is our focus. We will recover your data in a cost effective and efficient manner. We recover all operating systems and media....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.