TGStat
TGStat
Type to search
Advanced channel search
  • flag English
    Site language
    flag Russian flag English flag Uzbek
  • Sign In
  • Catalog
    Channels and groups catalog Regional compilations Thematic compilations Платные каналы Search for channels
    Add a channel/group
  • Ratings
    Rating of channels Rating of groups Posts rating
    Ratings of brands and people
  • Analytics
  • Search by posts
  • Telegram monitoring
  • Promotion
    Advertising through Yandex Business Advertising in channels through TGStat Agency Advertising on TGStat.ru website
iOS Build & Run

18 Jan, 10:55

Open in Telegram Share Report

Оператор &* - переполняющее умножение (overflowing multiplication).

&*:
• игнорирует переполнение;
• выполняет умножение по модулю диапазона типа;
• не вызывает runtime error.
___

Для Int8 диапазон: -128...127

Общая формула: result = (a * b) mod 2^N
mod - остаток от деления (%), но не может быть отрицательным.

Числа, выходящие за пределы, оборачиваются по модулю 256 (2^8).

Наглядно

0000_0000 - 0
0000_0001 - 1
...
0111_1111 - 127
1000_0000 - -128
1000_0001 - -127
...
1111_1111 - -1
опять 0000_0000 - 0


32 * 4 = 128
128 не помещается в Int8.
Битовый паттерн зарезервирован под -128.

137 0 0 1
Catalog
Channels and groups catalog Channels compilations Search for channels Add a channel/group
Ratings
Rating of Telegram channels Rating of Telegram groups Posts rating Ratings of brands and people
API
API statistics Search API of posts API Callback
Our channels
@TGStat @TGStat_Chat @telepulse @TGStatAPI
Read
Академия TGStat Telegram Research 2019 Telegram Research 2021 Telegram Research 2023
Contacts
Справочный центр Support Email Jobs
Miscellaneous
Terms and conditions Privacy policy Public offer
Our bots
@TGStat_Bot @SearcheeBot @TGAlertsBot @tg_analytics_bot @TGStatChatBot