float(i) or (float)i ?
float(i) or (float)i ?
concerning basic types like int, float, etc... when I have to specify conversion, I always ask myself if the notation float(i) is totally equivalent to (float)i in term of compiling efficiency ?
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: float(i) or (float)i ?
Means the same thing.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: float(i) or (float)i ?
Since C++ has constructors, int( i ) is valid whereas last time I tried that in C the compiler gave me errors.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
Re: float(i) or (float)i ?
ok thx, I was just curious.