間違ってない?

アバター
ptolemy
記事: 258
登録日時: 11年前

間違ってない?

投稿記事 by ptolemy » 9年前

コーディングを支える技術という書籍で、
► スポイラーを表示
と書かれていたけれど、「!aはa==0と同じ」と今まで理解していたので、凄く不安。

私の理解が間違っているのか書籍が間違っているのか不安なので意見くれたら嬉しいです。

質問というよりあくまで日記なのでこちらに書かせていただきました。
最後に編集したユーザー ptolemy on 2016年1月24日(日) 15:46 [ 編集 1 回目 ]

アバター
みけCAT
記事: 6734
登録日時: 14年前

Re: 間違ってない?

投稿記事 by みけCAT » 9年前

N1256より転載
6.5.3.3 Unary arithmetic operators さんが書きました: 5 The result of the logical negation operator ! is 0 if the value of its operand compares
unequal to 0, 1 if the value of its operand compares equal to 0. The result has type int.
The expression !E is equivalent to (0==E).


アバター
ptolemy
記事: 258
登録日時: 11年前

Re: 間違ってない?

投稿記事 by ptolemy » 9年前

皆さん有難うございます。
証明していただきスッキリしました。

ISLe
記事: 2650
登録日時: 14年前

Re: 間違ってない?

投稿記事 by ISLe » 9年前

????
成功したときにエラー処理する仕様なのだろうか?