Hi,
I am having problem with floating point operation. whenever I perform the following codes I get the error mentioned later.
///////////////////////////////////////////////////////////////////////////////////////
float a = 1.0, b = 2.3;//global var
a = a + b;
///////////////////////////////////////////////////////////////////////////////////////
Message #0
Message: FUN: bad bit number
SAT: bad bit number
FOV: bad bit number
SAT: bad bit number
RND: bad bit number
Need help, soon, thanks in advance.
Imran
Floating Point Arithmatic operation
Re: Floating Point Arithmatic operation
I couldn't get this message. The code I used for testing is:Which PIC do you use? Some PIC18s have a pre-defined constant a.
Code: Select all
float aa = 1.0, bb = 2.3;
void main() {
aa= aa + bb;
}//~!
pizon
PIC Specification
Hi,
Thanks for the reply. The PIC I am using for the code is PIC16F870 and for that even ur sample code does not work I have tried it totally in a new C file. Please let me know what to do. Thanks,
Imran.
Thanks for the reply. The PIC I am using for the code is PIC16F870 and for that even ur sample code does not work I have tried it totally in a new C file. Please let me know what to do. Thanks,
Imran.
Crystal Speed
I forgot to mention the Srystal speed in the previous message it is 4.0000MHz.
Thanks,
Imran
Thanks,
Imran
[img]http://www.geocities.com/imyousuf_nsu/FloatError.JPG[/img]
This is the screen shot of the error testing
Imran
This is the screen shot of the error testing
Imran
There is a similar type error in case of casting see the following screenshot.
[img]http://www.geocities.com/imyousuf_nsu/CastError.JPG[/img]
Thanks in advance for a quick resolution.
Imran
[img]http://www.geocities.com/imyousuf_nsu/CastError.JPG[/img]
Thanks in advance for a quick resolution.
Imran
imyousuf wrote:There is a similar type error in case of casting see the
Imran
Which version of mikroC do you use (if it is not 2.0.0.3 latest, please download it and give it the try).
One more possibilty is that search path for the project get corrupted.
Go to options->search paths
And Then:
1.(if you use p16 family)
if there is any path to ..\uses\p18 please remove it
2.(if you use p18 family)
if there is any path to ..\uses\p16 please remove it
Problem Solved in 2.0.0.3
Hi Everybody,
The Floating Point Arithmatic problem does not occur in the Current available version (2.0.0.3). Thanks for all the help,
Imran.
The Floating Point Arithmatic problem does not occur in the Current available version (2.0.0.3). Thanks for all the help,
Imran.