Sign in to follow this  
Followers 0
edda

Real to Int

4 posts in this topic

Hi all... Is it possible to convert Real to 16bitars Integer in some way? can i for example do it like this... L DB10.DBD0 RND T DB10.DBW4 or will it have problem with the 16 bitars int? Edited by edda

Share this post


Link to post
Share on other sites
Generally speaking - no, you can't.

Share this post


Link to post
Share on other sites
well sure if it fits in this area... i was just curious

Share this post


Link to post
Share on other sites
Well, people usually don't remember/know that the code below works well only when real_number is in range <0.0 .. 32767.0>. (OK, with RND it works well in fact for numbers in range <-0.5 .. 32767.5) but it does not change much) L real_number RND T int_number

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0