Hello,
I am puzzled by the fact that g++ (4.4.1, 64-bit Gentoo) allows me to
compile following line without any error:
int value = 2.5;
Also, the following program is compiled without any error or warning
using 'g++ main.cpp':
#include <stdlib.h>
#include <iostream>
int main() {
int value = abs(2.4);
value = 2.5;
std::cout << value << std::endl;
return 0;
}
I tried to search the web but I still do not have any clue why it
converts from double to int by default. This seems pretty dangerous to
me. Am I missing something?
Thank you.
IH.