!!2 == !!0+1

By 1 mwgamera on January 31, 2007

Embed Claim Make a related claim

Discussion (8)

http://mwgamera.name/

1 mwgamera who agreed, says

Note the priority of operations and the programming tag.

Make a related claim about 1 year ago (link)
http://mastahizm.mooo.com/

No_score Tomasz Sieprawski who agreed, says

This is true.
But, how the false and the truth can be added? :)

Make a related claim about 1 year ago (link)
http://mwgamera.name/

1 mwgamera who agreed, says

They can because of programming tag :P

Make a related claim about 1 year ago (link)
http://mart.degeneration.co.uk/

3 Martin Atkins who hasn't voted, says

Type mismatch error.

Make a related claim about 1 year ago (link)

Claims inspired by this comment

!!2 !== !!0+1
http://mwgamera.name/

1 mwgamera who agreed, says

What evil language do you use?
String typization sux!

Make a related claim about 1 year ago (link)
http://vynce.myopenid.com/

8 Vynce who hasn't voted, says

"order of operations" depends on the language, and you haven't specified one.

Make a related claim about 1 year ago (link)
http://mwgamera.name/

1 mwgamera who agreed, says

Hmm… that’s true…

However (!!2 == !!0+1) is true for most of them.
i.e. C (and C++), pike, perl, and probably many others…

Make a related claim about 1 year ago (link)
http://wyrframe.myopenid.com/

1 Wyrframe who disagreed, says

1. 2 is not a logical value. It is an integer value.

2. AFAIK, !0 is defined no stricter than 'non-zero' in all programming languages that allow implicit cross-casting between integer and boolean types. Thus, between different compilers !!2 == !(0) != 0. You can make no assertion about the actual value of !0.

3. This is not a claim. This is wordplay, and wordplay is only clever, not useful or truthful.

Make a related claim 5 months ago (link)
Sign in in to leave a comment.