263 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
-1
votes
1
answer
54
views
Is there a way to make Python interpret `~3` as an unsigned integer?
Is there a way to make Python interpret ~3 as an unsigned integer?
0
votes
2
answers
45
views
MIPS. 1 NOR 1 == -2?
I am trying to implement logical not in MIPS. I have read several suggestions that I implement it by nor $T1, $T1, $T1 or nor $T1, $T1, 0ドル.
The spec seems to support this working, but when I nor 1 ...
0
votes
1
answer
83
views
Negation as a Conclusion from And.Intro and Or.Elim
Below is a solution to a basic exercise from chapter 3 of "Theorem Proving in Lean 4". It shows, separately, both directions of the Theorem ¬(p ∨ q) ↔ ¬p ∧ ¬q.
The error message in both ...
0
votes
1
answer
57
views
PROLOG predicate returns false and negation does as well (using not)
I have the following rules set up.
pokemonOfType(charmander, fire).
pokemonOfType(staryu, water).
typeWins(water, fire). % this should not affect the outcome,
% but who knows
...
1
vote
2
answers
102
views
Prolog order of clause body gives different results when using negation
I am struggling to understand why swapping the two body clauses gives different results when one of the clauses is a negation.
married(john).
male(john).
male(kev).
bachelor1(X) :- \+ married(X), ...
1
vote
1
answer
31
views
Negation in UIMA Ruta Not Equal
I am new to Ruta and trying to write a rule containing a negation. What I want is something like this:
((POS.PosValue == "ADJA")|(POS.PosValue == "ADJD") & -(...
-2
votes
2
answers
160
views
Conditional statement `if ( ( i != '7' ) && ( j != '8' ) && ( k != '9' ) )` yields erratic results [closed]
#include <unistd.h>
void triplet(void);
int main(void)
{
triplet();
}
void triplet(void)
{
char i, j, k;
i = '0';
j = '1';
k = '2';
while (i < j)
{
i + ...
0
votes
2
answers
90
views
How the if statement is true?
I know that output of the program is "GOD".
How is the code written in the if statement true?
This is Boolean calculation and I don't understand this.
Please someone elaborate what is ...
0
votes
2
answers
93
views
if-else unpredictable behaviour
I am trying to write a basic C program to display contents of a file on the screen.
I am facing a problem with the way if-else seems to work. Here are two codes which I think should work the same, but ...
2
votes
4
answers
187
views
The difference between (x^y) and !(!(x^y))
I am a new computer science undergrad. For my assignment I need to implement isNotEqual(int x, int y) function in C by just using bitwise operators. This function will return false if x and y are ...
0
votes
3
answers
174
views
Why does exactly -LLONG_MIN lead to undefined behavior?
Why does exactly -LLONG_MIN lead to undefined behavior?
C11, 6.5.3.3p3:
The result of the unary - operator is the negative of its (promoted) operand. The integer
promotions are performed on the ...
0
votes
1
answer
74
views
Why does logically negating an unused optional argument throw an error?
I am attempting to solve exercise 5.5 of the tutorial
Write an interactive function with an optional argument that tests whether its argument, a number, is greater than or equal to, or else, less ...
1
vote
1
answer
58
views
Usage assert(not <condition>) [duplicate]
Reference: std::is_sorted
In the example section of the above link, I see the following usage:
int data[] = {3, 1, 4, 1, 5};
assert(not std::is_sorted(std::begin(data), std::end(data)));
I am ...
0
votes
1
answer
3k
views
Trying to select a value that does not contain using jq
We have many racks of servers of three types. One type is our storage cluster using weka. All of the hostnames begin with weka. The other two are compute and GPU nodes. Both start with a common ...
1
vote
1
answer
63
views
Conditional negation of T/F vector
Can the ! operator, or its opposite, be assigned dynamically to a variable then serve as a calculation input? There is a set of data.frames whose subsets I switch depending on a T/F condition. Here’s ...