Since when are negative floating points supported in C++?

I never needed negative floating points in my projects, and also in addition I heard somewhere lol, that negative floats and doubles are not supported by standard.

I just wrote following just to miraculously discover that negative floating points do work :)

1
2
3
float x = -4.3;
float y = 4.2;
cout << x + y << endl;



Program output:
-0.1


So what's the trick with negative floating points, are they supported by standard or not?
Last edited on
are they supported by standard or not?
Of course they are and it was always so.
Of course they are and it was always so.

hm, ok, I must have been living on another planet.
Most bizarre question ever.

Even the Z3 (1943) had floating point. And of course it had negative numbers!
...and C before it.

@malibor, don't sweat it though, all of us run into something we didn't realize was there.
Topic archived. No new replies allowed.