473,384 Members | 1,854 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,384 software developers and data experts.

Exception class EInvalidOp: invalid floating point operation (x-posted w/ borland.cppbuilder.cpp)

Hello,

I am working on a project in Borland Developer Studio 2006, and am
running into an error I
don't understand. Here is the relevant code:

//---------------------------------------------------
double splitLoc = 0, fs = 512;
double timeRange[3];
int tArr[3];

// these values come from a file, and just happen to be in the one I am
using now
timeRange[0] = -1.5;
tArr[0] = 0;
tArr[2] = 0;

// This is where the error occurs
splitLoc += timeRange[0] * fs; //this is fine
splitLoc += (double)(tArr[2] - tArr[0]);
//----------------------------------------------------

This last line always throws the exception:
First chance exception at $7C81EB33. Exception class EInvalidOp with
message 'Invalid floating point operation'. Process test.exe (3040)

The program compiles fine, so what else could be causing this?
Thanks!
Adam

Feb 19 '06 #1
2 9152
In article <11**********************@o13g2000cwo.googlegroups .com>,
"jawilson" <ja******@cae.wisc.edu> wrote:
Hello,

I am working on a project in Borland Developer Studio 2006, and am
running into an error I
don't understand. Here is the relevant code:

//---------------------------------------------------
double splitLoc = 0, fs = 512;
double timeRange[3];
int tArr[3];

// these values come from a file, and just happen to be in the one I am
using now
timeRange[0] = -1.5;
tArr[0] = 0;
tArr[2] = 0;

// This is where the error occurs
splitLoc += timeRange[0] * fs; //this is fine
splitLoc += (double)(tArr[2] - tArr[0]);
//----------------------------------------------------

This last line always throws the exception:
First chance exception at $7C81EB33. Exception class EInvalidOp with
message 'Invalid floating point operation'. Process test.exe (3040)

The program compiles fine, so what else could be causing this?
Thanks!
Adam


I wrapped your code in main and it works fine... If that last line is
throwing an exception, it's being cause by something other than what you
posted. Chances are, some code is going past an array boundary.

--
Magic depends on tradition and belief. It does not welcome observation,
nor does it profit by experiment. On the other hand, science is based
on experience; it is open to correction by observation and experiment.
Feb 19 '06 #2
When I opened the project in C++Builder 6 instead of the new version
(BDS 2006), it ran fine. Nothing in the code changed, and I'm pretty
certain that the code is not going past an array boundary. This seems
to be a borland config issue, and not a C++ issue now, but I'm still
hoping someone might have an answer.
Adam

Feb 19 '06 #3

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

Similar topics

21
by: Allin Cottrell | last post by:
OK, I realize that what I am asking here is not likely to have a answer within the C standard. Nonetheless, it is not specific to any particular platform, so I'll hazard the question anyway. A...
13
by: Chris Stankevitz | last post by:
Hi, I have a very large Visual c++ .net 2003 7.1 native c application (approximately 500,000 lines of code). This application is a simulation that frequently works with floating point numbers....
2
by: marko.suonpera | last post by:
I'm using the Newmat library where element access in ColumnVector type is defined as follows: typedef double Real; Real& ColumnVector::operator()(int m) { REPORT if (m<=0 || mnrows)...
2
by: Martin Manns | last post by:
Hi, I am experiencing some trouble with gmpy v1.01. Multiplying an mpq with inf results in a floating point exception that exits python. Has this already been fixed in newer gmpy versions? ~...
3
by: LSW | last post by:
I'm using Borland Turbo C++ 3.0 to develop an embedded system to shift data around a network. At the moment we receive a string of bytes over a serial line and reassemble them into floating point...
4
by: mathieu | last post by:
Hi, I am working on an IO library, and I am reading a binary blob which represent a floating point. I would like to know what is the correct way to interpret it. For integer type using a...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.