c++ question
c++ question
- Started
- Last post
- 2 Responses
- fugged
trying to port some c++ functions to actionscript and i don't know the first thing about c++.
i'm confused by the following statement:
fabs(logi - (long) logi);
i know it's calculating the absolute value (as a float) of the expression logi - (long) logi, but i don't understand what the logi - (long) logi is.
any one have any ideas on wtf this is doing?
much thanks.
- g3kk0k1d0
my guess it is giving you the decimal places,
i'm assuming logi is a float value
(long)logi: is typecasting the logi variable to be a whole number,
and by subtracting that from the float value you are getting the decimal places,
example:
logi: 10.202
logi - (long)logi = 10.202 - 10
equals = 0.202
- fugged0
ah. thanks.