I think there is a problem in G++ compiler about double operation.
I was trying to test some program, and found bugs in comparing(==) double. So, I read some articles and