# Question about \>\< and !=

**URL:** https://discourse.processing.org/t/question-about-and/31419
**Category:** Beginners
**Created:** [July 24, 2021, 10:37am UTC](https://discourse.processing.org/t/question-about-and/31419 "2021-07-24T10:37:54Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![MoonAlien822](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)
#### Post date: [July 24, 2021, 10:37am UTC](https://discourse.processing.org/t/question-about-and/31419/1 "2021-07-24T10:37:54Z")

</div>

Is

`If(x >< 16){print(“yes”)}`

The same as

`If (x != 16){print(“yes”)}`  
?

---

<div class="post-metadata">

### Author: ![javagar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/javagar/32/11434_2.png) [@javagar](https://discourse.processing.org/u/javagar)
#### Post date: [July 24, 2021, 10:58am UTC](https://discourse.processing.org/t/question-about-and/31419/2 "2021-07-24T10:58:48Z")

</div>

See [Oracle: Operators](https://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html).

`><` is not in the list.

---

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [July 24, 2021, 11:01am UTC](https://discourse.processing.org/t/question-about-and/31419/3 "2021-07-24T11:01:15Z")

</div>

Hello,

Please post code that is properly formatted and does not have syntax errors.

You should try all your examples first and then ask questions.

Please do a bit of research in advance.

Do a Google search for:  
_relational operators java_  
_conditional operators java_  
_logical operators java_

Search the Processing references for:  
_relational operators_  
_logical operators_

Please read:

- [Processing FAQ - Frequently asked questions](https://discourse.processing.org/faq)
- [Guidelines - Asking Questions](https://discourse.processing.org/t/guidelines-asking-questions/2147/4)
- [Guidelines - Answering Questions](https://discourse.processing.org/t/guidelines-answering-questions/2145/1)
- [p5.js Community Statement](https://p5js.org/community/)

Our homework policy:  
[https://discourse.processing.org/faq#homework](https://discourse.processing.org/faq#homework)

_Students are responsible for following the policies of their school, class, and instructor. Post as if your instructor is reading._

If this is a homework question please tag it as _homework_ .

Please format your code as a courtesy to the community:  
[https://discourse.processing.org/faq#format-your-code](https://discourse.processing.org/faq#format-your-code)

`:)`

---

<div class="post-metadata">

### Author: ![MoonAlien822](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@MoonAlien822](https://discourse.processing.org/u/MoonAlien822)
#### Post date: [July 24, 2021, 8:30pm UTC](https://discourse.processing.org/t/question-about-and/31419/5 "2021-07-24T20:30:48Z")

</div>

Oh, I thought it looked if it was either one because that would be consistent with the rest ==(equals or equals) \<=(smaller than or equals) \>(bigger than or equals) so I assumed \>\<(bigger than or smaller than)

---

<div class="post-metadata">

### Author: ![javagar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/javagar/32/11434_2.png) [@javagar](https://discourse.processing.org/u/javagar)
#### Post date: [July 25, 2021, 12:16am UTC](https://discourse.processing.org/t/question-about-and/31419/6 "2021-07-25T00:16:23Z")

</div>

Some relational operators differ between languages. PHP and SQL include `<>` as one that means _not equal to_, while many other languages use only `!=` for that purpose. I’m not aware of any that use `><`. If you do find one that does, please let us know.

It’s best to look at the documentation for whatever language you are using to become familiar with what operators are available.

---

<div class="post-metadata">

### Author: ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)
#### Post date: [August 2, 2021, 3:45am UTC](https://discourse.processing.org/t/question-about-and/31419/7 "2021-08-02T03:45:36Z")

</div>

hi

try find more yourself

```auto
for (int x = 15;x < 17; x ++) {

if ((x> 16) || (x<16)) {
 println("yes");
}
if ((x> 16) && (x<16)) {
 println(" true");
} else {
   println(" &"); 
  
}
if (x != 16) {
 println("no ");
}
}

```

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [August 18, 2021, 3:50am UTC](https://discourse.processing.org/t/question-about-and/31419/8 "2021-08-18T03:50:00Z")

</div>

> [@MoonAlien822](#):
>
> so I assumed \>\<(bigger than or smaller than)

> [@javagar](#):
>
> PHP and SQL include `<>` as one that means _not equal to_ , while many other languages use only `!=` for that purpose.

More generally, the thing you are interested in across programming languages is a relational operator

> **[Relational operator | Standard relational operators](https://en.wikipedia.org/wiki/Relational_operator#Standard_relational_operators)**
>
> The most common numerical relational operators used in programming languages are shown below. Standard SQL uses the same operators as BASIC, while many databases allow != in addition to \<\> from the standard. SQL follows strict boolean algebra, i.e. doesn't use short-circuit evaluation, which is common to most languages below. E.g. PHP has it, but otherwise it has these same two operators defined as aliases, like many SQL databases.

and this one is the inequality operator. It does make sense to say:

> x \<\> y … “x is less than or greater than y”

Languages like BASIC, ML, and Pascal went with that.

On the other hand, the C-like languages such as C / C++ / C# / Java / JavaScript / PHP / etc. went with:

> x != y … “x is not equal to y”

Processing does `!=`, which it gets from Java. p5.js does it too (from JavaScript) and all the Python modes of Processing do it (from Python) – although they also use “is not” in some cases.

One advantage to `!=` is that the concept “not equal” works if x and y are two numbers … OR two colors, or two videos, or two cities, or anything else that doesn’t necessarily have a logical “greater or less than” but can still be “not equal”.
