if 1: return True

Soy 0 got truthmogged by chad 1 ๐Ÿ˜Ž

589 points · 27 comments · view on lemmy.world

27 Comments

NaibofTabr@infosec.pub · 47 pts · 209d (5 replies)

I think I saw a 2...

i_am_tired_boss@lemmy.world · 47 pts · 209d (1 reply)

Go back to bed bender, there's no such thing as a 2

ILikeBoobies@lemmy.ca · 25 pts · 209d

https://en.wikipedia.org/wiki/Ternary_computer

Think of the fun we'd have, still no 2 though.

ceenote@lemmy.world · 8 pts · 209d (1 reply)

Fake news. There's no such thing as a 2.

MasterNerd@lemmy.zip · 1 pts · 157d

MasterNerd@lemmy.zip · 1 pts · 157d

Nah you're just reading the voltage instead of its logical representation

ZILtoid1991@lemmy.world · 32 pts · 209d (4 replies)

Now get ready for fuzzy logic!

  • -1.0 = false
  • 0.0 = neutral
  • 1.0 = true

Also now you know more about AI than most AI bros on the internet.

DarkenLM@sh.itjust.works · 7 pts · 209d (1 reply)
kubica@fedia.io · 1 pts · 209d (1 reply)

The not so funny thing is that if you try this in scripting languages -1 and 1 are both truthy so...

ZILtoid1991@lemmy.world · 1 pts · 209d

Because you need to infer the fuzzy boolean as a type (I personally plan to make one that works between -127 and 127, on integers instead of floats), and then write an interpreter to use the values accordingly.

_cnt0@sh.itjust.works · 28 pts · 209d (3 replies)

C be like "this shit is true af" and it's the number 6396128.

jaybone@lemmy.zip · 23 pts · 209d (2 replies)

And itโ€™s an error code from a library call, because false means the call succeeded.

_cnt0@sh.itjust.works · 9 pts · 209d (1 reply)

This is the way. Exceptions are overrated.

Scrath@lemmy.dbzer0.com · 1 pts · 171d

I used to use enums for my return codes.

Then I got pissed I had to add my enum definition to every project I worked on.

I now return integers based on errno

Scoopta@programming.dev · 23 pts · 210d (3 replies)

Bash would be confused

A_norny_mousse@piefed.zip · 6 pts · 209d (1 reply)

I'd just like to interject for a moment. What you're refering to as Bash, does in fact apply to all UNIX-like shells.

Scoopta@programming.dev · 1 pts · 209d

Yes I know, I was gonna say "shell is confused" but it just didn't feel like it had the same ring to it

zero_spelled_with_an_ecks@programming.dev · 5 pts · 209d

Use perl exec to run a bash script. Now you're confused, too. And not just about why you're using perl.

bampop@lemmy.world · 15 pts · 209d

if (true) return BIG;

A_norny_mousse@piefed.zip · 13 pts · 209d (1 reply)

Bool me once, shame on thee. Bool me twice, shame on me.

kubica@fedia.io · 2 pts · 209d

Bool or bool not, there's no twice.

massive_bereavement@fedia.io · 12 pts · 209d

I think some memes should have a sign that says: "You must be this high to ride".

FreshLight@sh.itjust.works · 5 pts · 209d

I think that this couldn't be any funnier.

stupidcasey@lemmy.world · 5 pts · 210d

True.

sbeak@sopuli.xyz · 4 pts · 209d (2 replies)

1.00 is so real

sbeak@sopuli.xyz · 1 pts · 209d (1 reply)
[ removed ]
A_norny_mousse@piefed.zip · 1 pts · 209d
[ removed ]
GlenRambo@jlai.lu · 2 pts · 209d

New Drake meme format?

Orange jacket guy, for those that don't know. https://knowyourmeme.com/memes/drakeposting/photos and now you know.