solved

Pages: 12
L B wrote:
you can't put -b. You CAN however do 0-b, which is what you want.

Are you sure that doubles don't have the unary operator - ?
They do, but it gives me a compiler error if I try to do x = (-b). I guess I'm doing it wrong.
LB wrote:
They do, but it gives me a compiler error if I try to do x = (-b).

What compiler are you using and what error does it give? That's looks perfectly legal to me.
It tells that it expected a 'primary expression' before '-'.
It tells that it expected a 'primary expression' before '-'.
mate, try with
x==-b
ok ?
this is working in all C++ programming languages. trust me.
and oh, dont use () , and do == instead of =. this works for me. i hope i helped
Topic archived. No new replies allowed.
Pages: 12