Floating Point Arithmatic operation

General discussion on mikroC.
Post Reply
Author
Message
imyousuf
Posts: 9
Joined: 11 Jun 2005 10:51
Location: Dhaka, Bangladesh
Contact:

Floating Point Arithmatic operation

#1 Post by imyousuf » 11 Jun 2005 10:56

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

pizon
mikroElektronika team
Posts: 823
Joined: 11 Oct 2004 08:53

Re: Floating Point Arithmatic operation

#2 Post by pizon » 11 Jun 2005 11:14

I couldn't get this message. The code I used for testing is:

Code: Select all

float aa = 1.0, bb = 2.3;


void main() {
  aa= aa + bb;

}//~!
Which PIC do you use? Some PIC18s have a pre-defined constant a.
pizon

imyousuf
Posts: 9
Joined: 11 Jun 2005 10:51
Location: Dhaka, Bangladesh
Contact:

PIC Specification

#3 Post by imyousuf » 12 Jun 2005 03:33

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.

imyousuf
Posts: 9
Joined: 11 Jun 2005 10:51
Location: Dhaka, Bangladesh
Contact:

Crystal Speed

#4 Post by imyousuf » 12 Jun 2005 09:59

I forgot to mention the Srystal speed in the previous message it is 4.0000MHz.
Thanks,

Imran

imyousuf
Posts: 9
Joined: 11 Jun 2005 10:51
Location: Dhaka, Bangladesh
Contact:

#5 Post by imyousuf » 12 Jun 2005 10:33

[img]http://www.geocities.com/imyousuf_nsu/FloatError.JPG[/img]
This is the screen shot of the error testing

Imran

imyousuf
Posts: 9
Joined: 11 Jun 2005 10:51
Location: Dhaka, Bangladesh
Contact:

#6 Post by imyousuf » 12 Jun 2005 11:30

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

User avatar
rajkovic
mikroElektronika team
Posts: 694
Joined: 16 Aug 2004 12:40

#7 Post by rajkovic » 13 Jun 2005 08:18

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

imyousuf
Posts: 9
Joined: 11 Jun 2005 10:51
Location: Dhaka, Bangladesh
Contact:

#8 Post by imyousuf » 13 Jun 2005 11:47

Options-->Search Path does not have any .../Uses/P18/ and my version is 2.0.0.2, did it have this error before? Do I really have to upgrade?

Imran

pizon
mikroElektronika team
Posts: 823
Joined: 11 Oct 2004 08:53

#9 Post by pizon » 13 Jun 2005 23:12

imyousuf wrote:Do I really have to upgrade?
Please do. You could wait for another day or two for version 2.0.0.4 to become available, but you should always upgrade to the latest version, especially for the minor releases that mostly do the bug fixes.
pizon

imyousuf
Posts: 9
Joined: 11 Jun 2005 10:51
Location: Dhaka, Bangladesh
Contact:

Problem Solved in 2.0.0.3

#10 Post by imyousuf » 15 Jun 2005 03:35

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.

Post Reply

Return to “mikroC General”