Simple program returning hexadecimals instead of double

Hello,

I wrote a simple program in xcode

1
2
3
4
5
6
7
#include <iostream>

int main() {
std::cout<<21.5<<std::endl;

return 0;
}


And I get the following

15.87807FFF7D45EF780

What am I doing wrong?
Last edited on
The issue is not reproducible with that piece of code. See http://ideone.com/JHNAz . In there, it works as expected. What is your compiler & OS?
Got the correct answer using Xcode:
This GDB was configured as "x86_64-apple-darwin".tty /dev/ttys002
Loading program into debugger…
Program loaded.
run
[Switching to process 911]
Running…
21.5

Debugger stopped.
Program exited with status value:0.

Last edited on
Topic archived. No new replies allowed.