News:

Let's find out together what makes a PIC Tick!

Main Menu

Preprocessor.exe Pow: Overflow error

Started by Amateurtje, Dec 29, 2022, 12:13 AM

Previous topic - Next topic

Amateurtje

Hello,

I receive during compiling the error: Preprocessor.exe      Pow: Overflow error

it also started to give an error on one of my symbols: 'symbol D'

I changed them all into 'D_'.  now it compiles correctly, but the error is still there..
it leaves also the file a.lst which is about 500kb..

while i do not know how they normally look like (there is some asm inside), it is difficult for me to get info for the error from that file..

it is a small program and i use these symbols also in another program without problems..

anybody knows what this error means?


Amateurtje


trastikata

Quote from: Amateurtje on Jan 02, 2023, 10:04 PMnobody any idea?

Can you provide a code snippet where the error appears?

Amateurtje

#3
I did not find the time yet to break down my program. I hoped anybody could tell me a usual cause of this error to point me in the right direction.. I will use the coming evenings to break down the program.... It appeared while building but solving the errors that he gave at the same moment, did not solve the error... I will let you know what i find or if i have a code snippet i will post it here..

When it appeared, i was introducing a lot of new symbols, and scripts i have used in another program without errors...

John Drew

I'm  away from my computer but fairly sure single letter identifiers are not permitted.
That is why you at least now have a compile.
The code snippet will help us help you when you have time to do that.
John

Amateurtje

Unbtill now, in other programs, it went never wrong.. I used them to make digits on a 7-segment display. (the 7 1's and 0' represent a letter on the display).. Ofcourse, I can make them more letters but it reads nicer in the code when it is 1 letter.

I hope to have energy left this evening  ;D  ;D

thanks

top204

The preprocessor is a seperate program to the compiler and uses the computer's capabilities for its floating point functions. So the Pow is trying to take the power of a value that is too large for it. Hence the overflow error.

Pow can produce extremely large values that are often larger than a compiler or floating point unit can handle.

Amateurtje

As far as I know I do not have a floating pont value (or it sees the symbols as floating points, but they are all byte values). As I understand, Pow is a function, isn't it.. That, I do not use anywhere...

I have no clue where I use floating point variables in this script (no floats defined), but I will try to break the code down...

top204

#8
The preprocessor uses both integer and floating point for its "built in" expression functions, so even integer values will overflow if they are created too large. But the error indicates it is a floating point overflow.

I have no control over the limits of the C++ compiler's built in functions that use the computer's floating point hardware, so it will have limits. Now that 64-bit machines are dominant, I will get back into the preprocessor at some time and make it 64-bit compatible.

Amateurtje

Got it,

IT was the combination:

Symbol B = %00101100
And in the program:
Dig_4 = B 'Dig_4 is a byte variable
Solved by changing to:
Symbol B_ = %00101100
Dig_4 = B_

To be sure, I will change all single letter symbols to "X_"

Thanks for the help