Problem Real->Long

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 12/07/2004 at 01:12, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   8.207 
Platform:   Windows  ;   
Language(s) :     C++  ;

---------
I still have problems conversing real to long. I use GetPos() to get the position of an object, then something like LONG posx = GetPos().x; I even tried LONG posx = SAFELONG( GetPos().x );
The result is the same: sometimes the values differ by 1! For example, the attribute manager says x position = 74, debug of vc says GetPos().x = 74.000....and posx = 73!
I thought that SAFELONG would fix that, but it doesnt. I really need to understand why that happens, the real mathematic reason, and how I can fix it, 1 pixel in our application is extremely important!
How does the attribute manager display the position? He always displays the correct position, somehow he also has to call GetPos()......

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 12/07/2004 at 02:49, xxxxxxxx wrote:

Ok....thought SAFELONG would handle that, and the compiler would show the exact values.....
+0.5/-0.5 and it works....