Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.
Zero Tolerance for Disrespect

divided wrong

Featured Replies

  • Author
  • Localization

Shokoniraya, posted Wed Feb 13, 2019 11:37 am (43438)


Code:
math SIZEQ = 17
if SIZEQ / 16
print "%SIZEQ%"
endif
break

you can see, i post a very simple code
if SIZEQ divided by 16, then print it. but must print nothing. what is the wrong?
  • Author
  • Localization

Delutto, posted Wed Feb 13, 2019 12:56 pm (43442)


Code:
math SIZEQ = 17
xmath MOD "SIZEQ % 16"
if MOD = 0
   print "%SIZEQ%"
endif
aluigi wrote:
There's a "if not" instruction?
  • Author
  • Localization

aluigi, posted Wed Feb 13, 2019 1:26 pm (43445)


Just replace / with % and it works.
You also have an useless "break" there.

17 / 16 = 1
16 / 16 = 1
17 % 16 = 1
16 % 16 = 0
It's just math :)
  • Author
  • Localization

Delutto, posted Wed Feb 13, 2019 1:46 pm (43448)


aluigi wrote:
Just replace / with % and it works.
But it'll do the opposite, that's why I asked you for a "if not" like instruction.
  • Author
  • Localization

aluigi, posted Wed Feb 13, 2019 2:32 pm (43451)


Ah sorry, I replied to Shokoniraya only.

Anyway you are right, there is no "if not".
I just use "if ... else" for handling these cases.
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.