Advertisement Jump to content


This topic is now archived and is closed to further replies.


Float-returning function failure

This topic is 5364 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m working on a pretty simple scripting engine, one of the features of which is calling functions that recide in the compiled EXE from scripts. Everything was working perfect until I recoded the system to use floating point math instead of integer. After a little debugging though, most of the problems were solved, but one specific problem had me completely baffled - it is impossible to get functions to return any sensible value! Take a look at the following images: This is inside the function I called from a script. The parameters passed to it is one float that just gets returned again, and one pointer to void, which is the identifier of the calling script. Here we have returned from the function and as you can see, the function being called is the correct one. Since passing arguments to functions works just fine, I decided not to include a screenshot of it. This is at the same point as the last screenshot, but shows that tmp now has a totally insane value. EAX has a value somewhere around 3.4 billion, viewed as an integer and 3.4359739e+009 when viewed as a float. I have absolutely no idea what''s going on here. Is the compiler playing some joke on me here or have I missed something totally obvious?

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!