Search found 3 matches

by dscattergood
11 Mar 2012 00:23
Forum: mikroC PRO for PIC General
Topic: Int to float issue
Replies: 6
Views: 1777

Re: Int to float issue

Thanks for the help guys, I sorted it by using 'sprintf' instead.
I've never used it before, it seems to be a very flexible command that I wish i'd found sooner

thanks

David
by dscattergood
06 Mar 2012 14:00
Forum: mikroC PRO for PIC General
Topic: Int to float issue
Replies: 6
Views: 1777

Re: Int to float issue

Hi Here is the code that has the problem when I put it into my 18F4550... void main() { char temp_string[10]; int temp_int; float temp_float; UART1_Init(9600); UART1_Write(0xFE); //LCD home UART1_Write(0x51); UART1_Write(0xFE); //LCD contrast UART1_Write(0x52); UART1_Write(0x1E); do { for ( temp_int...
by dscattergood
03 Mar 2012 18:12
Forum: mikroC PRO for PIC General
Topic: Int to float issue
Replies: 6
Views: 1777

Int to float issue

Hi I tried to turn an int to a float using temp_float = temp_int; for some numbers this worked fine, but for the majority it gives errors. eg. 0 - 10 works fine 11 comes out as 10.99991 12 comes out as 11.99991 etc however 15,16,20 (plus several other seemingly random numbers) work fine. Could anyon...

Go to advanced search