Jump to content
rbairos

Converting To Float Not Working

Recommended Posts

Hi All.

This is very frustrating:

 

 

 

{

int i = 5;

float f;

 

f = i;

}

 

 

causes:

 

mainloop.c

mainloop.c(404): error: can't convert 'signed int' to 'float'

mainloop.c(404:4): error: failed to generate expression

 

 

If I try:

f = (float)i;

 

results in:

 

mainloop.c

mainloop.c(404:13): internal error: can't assign operand to temp var

mainloop.c(404:6): error: failed to generate expression

mainloop.c(404:6): error: invalid operand '(float)i'

mainloop.c(404:4): error: failed to generate expression

 

 

 

Any help appreciated.

Share this post


Link to post
Share on other sites

rbairos,

 

This is very frustrating:

 

 

 

{

int i = 5;

float f;

 

f = i;

}

Native support for floating point is not yet supported. You need to use the appropriate floating point library function and add the floating point library to your project. Please read the Floating point library manual.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoticons maximum are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×