lundi 4 septembre 2017

Bitwise negation on double throws error [duplicate]

This question already has an answer here:

Its late night and Im little embarrased to ask:

Why bitwise negation on double type throws error?

I understand how double-precision floating point is stored in memory, but I sure am missing something...

double left = 1;
double nLeft = ~(left);

error: invalid argument type 'double' to unary expression
  double nLeft = ~(left);
                 ^~~~~~~

Aucun commentaire:

Enregistrer un commentaire