![]() |
Very wierd compiling problem!
Hey,
I've tried to make a very simple statment: Code:
float test = 3.14;Thanks. |
Re: Very wierd compiling problem!
Quote:
|
Re: Very wierd compiling problem!
So far as I can tell, with the C18 compiler we use,
1) strings to be printf'd need a terminating \r and 2) %f is not supported. |
Re: Very wierd compiling problem!
Quote:
|
Re: Very wierd compiling problem!
Quote:
|
Re: Very wierd compiling problem!
2 things:
To be technical, your error (as you've explained it) is run-time, not compile-time error. A run-time error is something odd that happens during the execution of the code that you didn't expect. It may be a crash or just may not print what you thought it would. The other "thing" is this: when do you need to print out floats? I dunno, maybe you do need them. Important values like motors are unsigned chars, however. Most of what you're working with is bits and chars. If you really need this to work, it's worth your time; otherwise, there are probably 400 better things to do. Best of luck with it... Paul dennis |
Re: Very wierd compiling problem!
If you absolutely must print out a float,do this: print the integer part, then take the remaining decimal part, multiply by some power of ten (say, 1000) and print out this number after a decimal point.
|
| All times are GMT -5. The time now is 01:39. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi