Skript icon indicating copy to clipboard operation
Skript copied to clipboard

Evenly Divisible has problems with decimals

Open SoITheIdiot opened this issue 7 months ago • 2 comments

Skript/Server Version

[Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[Skript] Server Version: 1.21.4-231-09e9afd (MC: 1.21.4)
[Skript] Skript Version: 2.11.0 (skriptlang-github)
[Skript] Installed Skript Addons:
[Skript] - SkBee v3.11.1 (https://github.com/ShaneBeee/SkBee)
[Skript] - skript-reflect v2.6 (https://github.com/SkriptLang/skript-reflect)
[Skript] Installed dependencies:
[Skript] - WorldGuard v7.0.13+82fdc65

Bug Description

Checking if a number is evenly divisible by a non whole number seems to not return true most the time even when the number is evenly divisible by said non whole number.

Expected Behavior

Should return as true, isn't returning as true.

Steps to Reproduce

command /test: trigger: broadcast "a" if 0.3 is evenly divisible by 0.1

Errors or Screenshots

Image

Other

No response

Agreement

  • [x] I have read the guidelines above and affirm I am following them with this report.

SoITheIdiot avatar Jun 07 '25 05:06 SoITheIdiot

Can replicate on latest

TheMug06 avatar Jun 07 '25 05:06 TheMug06

Likely due to floating point error. Marking as low due to many valid workarounds

sovdeeth avatar Jun 07 '25 06:06 sovdeeth