473,218 Members | 1,530 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,218 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 9127
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
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...

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.