[13.11] Comparing no signal in "Everything" returns true generaly

Bugs that are actually features.
Post Reply
arl85
Fast Inserter
Fast Inserter
Posts: 174
Joined: Tue Jun 10, 2014 7:08 am
Contact:

[13.11] Comparing no signal in "Everything" returns true generaly

Post by arl85 »

I already commented on it here but it seems to be considered "not a bug".
Still I'm sure it's a bug.

when you have no signal on a circuit any comparison with "Everything" signal returns true.

Image

I expect to receive false, because no signal passes comparison.

Maybe check is performed this way?

Code: Select all

output= true
for each signal on circuit
      if condition is false then
      output = false
      exit loop
loop
return output
Do you need help taking screenshots in-game? have a look to my guide to calculate screenshot dimensions

User avatar
TruePikachu
Filter Inserter
Filter Inserter
Posts: 978
Joined: Sat Apr 09, 2016 8:39 pm
Contact:

Re: [13.11] Comparing no signal in "Everything" returns true generaly

Post by TruePikachu »

This is not a bug. "Everything" ignores signals with a value of zero, by design.

EDIT: Just reread, still not a bug. All nonzero signals passed the condition. If you want to have false when everything is zero, multiply the "everything" output by the comparison "anything != 0".

EDIT: This is also true by convention; default for AND is TRUE just as default for addition is zero and multiplication is one.

`1+2` ≡ `0+1+2` ∴ `` ≡ `0`
`2*3` ≡ `1*2*3` ∴ `` ≡ `1`
`a⋁b` ≡ `F⋁a⋁b` ∴ `` ≡ `F`
`a⋀b` ≡ `T⋀a⋀b` ∴ `` ≡ `T`

Lisp also agrees with this logic (NIL ≡ F).

Code: Select all

[1]> (+) ; zero-arg addition
0
[2]> (*) ; zero-arg multiplication
1
[3]> (or) ; zero-arg boolean OR
NIL
[4]> (and) ; zero-arg boolean AND
T

Loewchen
Global Moderator
Global Moderator
Posts: 8320
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: [13.11] Comparing no signal in "Everything" returns true generaly

Post by Loewchen »

Yeah, this is the correct behaviour following the definition.

Post Reply

Return to “Not a bug”