Похожие чаты

There are two differrent contexts 1. if there two boolean expressions than &&

is called a 'short circuit' operator and & is a 'long circuit'
it means that
(3 < 2 && 3 < 5)
it will resolve that 3 < 2 is false, and will not even try to evaluate 3 < 5
but
(3 < 2 & 3 < 5)
it will evaluate both expressions
2. when oprators are both integral(char, byte, short, int, long)
than
1 && 2 will not even make sense, because && works only with logacal expressions(those that spit out booleans)
but
1 & 2 makes perfect sence, because in context of two integers it acts as a bitwise operator
1 in binary is 0001
2 in binary is 0010
so 1 & 2 = 0011
which is 3
3. why it happens? i think, because under the hood booleans are integral type which look like 0001 - true and 0000 - false, that is why``` 3<2 & 1<2``` will evaluate all expressions, it will simple do bitwise AND of false(0000) and true(0001)

1 ответов

4 просмотра

👍

Похожие вопросы

Обсуждают сегодня

А чем вам питонисты не угодили?😂
.
79
or any website to buy prepaid card with xmr that's not trocador that's down?
Umbrella Party Partner
18
Всем привет, написал код ниже, но он выдает сегфолт, в чем причина? #include <stdio.h> #include <stdlib.h> #include <string.h> struct product { char *name; float price; };...
buzz базз
75
Hi, I can't understand promises in JavaScript and what we should use them for (maybe the teacher didn't teach well XD). Do you have a solution for this? And are promises used...
A
29
Ещё такой вопрос. Мне необходимо хранить пароль пользователя локально. Для этого планирую использовать ini файл. Это для автозаполнения полей логин и пароль при авторизации. Е...
Евгений
19
всем доброго времени суток! имею вопрос: как понять ТОЧНО, что на нексус производится атака или он перегружен? исходные данные: - Nexus OSS 3.67.1-01 на OrientDB - Total co...
Michael Kostelcev
3
Ты просто гитлеровскую эстетику плохо понимаешь. Он же всё под Цезаря делал. А это как бы запрещённый приём в политике. Пиджаки они зачем все носят? Чтобы показать что они тип...
Ivan Kropotkin
4
Xem delist ho rha hai agr naa bhechu toh kya hoga after 1 july?
ABHI
27
i need usdt exchanged to xmr without kyc any site there ?
Certained
12
Did you guys see the latest tweet from TonGifts? 🚀
Mike
44
Карта сайта