Strange numbers bug

Alright so, there’s this peculiar thing that happens when I go ahead and subtract 0 from 50. The expected result should be 50, correct? However, ROBLOX turns it into a 49 regardless. I am awfully confused in general.

Code:

-- get game services
local uis = game:GetService("UserInputService")
local rs = game:GetService("RunService")
local plrs = game:GetService("Players")

-- define short-hand references for rlua stuff
local plr = plrs.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local hume = char:WaitForChild("Humanoid")

-- define short-hand references for related ui elements
local icon = script.Parent:WaitForChild("Icon")
local cdnum = icon:WaitForChild("Number")

-- define variables
local isJumping = false
local original = hume.JumpPower
local amountToLower = 0
local cooldown = 0
local constCooldown = 3

-- 
local function loadChar(new) 
	char = new; 
	hume = char:WaitForChild("Humanoid")
	hume:GetPropertyChangedSignal("FloorMaterial"):Connect(function()
		if hume.FloorMaterial == Enum.Material.Air and isJumping then isJumping = false end
	end)
end

-- if this is an actual character, then call loadChar
if plr.Character then
	loadChar(plr.Character)
end

-- attatch a function that initializes everything required when a character is added
plr.CharacterAdded:Connect(function(new) 
	amountToLower = 0
	cooldown = 0
	original = hume.JumpPower
	loadChar(new)
end)

-- detect whether or not a player is jumping when a jump-request is sent
uis.JumpRequest:Connect(function() 
	if hume.FloorMaterial ~= Enum.Material.Air and not isJumping then
		isJumping = true
		amountToLower = math.clamp(amountToLower + 2, 0, original)
		if amountToLower > 0 then cooldown = constCooldown end
	end
end)

spawn(function()
	while wait() do
		if cooldown > 0 and amountToLower > 0 then
			repeat cooldown = math.clamp(cooldown - 0.1, 0, math.huge); wait(0.1) until cooldown == 0
		end
	end
end)

spawn(function()
	while wait() do
		if cooldown == 0 and amountToLower > 0 then
			repeat amountToLower = math.clamp(amountToLower - 1, 0, original); wait(0.25) until (amountToLower == 0 or cooldown > 0) 
		end
	end
end)

-- core code required for drawing the UI and making it not look terrible
spawn(function()
	while wait() do
		if hume then
			if icon and cdnum then
				if amountToLower > 0 then
					hume.JumpPower = original - amountToLower
					cdnum.Text = tostring(hume.JumpPower)
				end
			end
		end
	end
end)

Place to see the effects:
https://www.roblox.com/games/6674572793/untitled-cube-game

Looks like maybe we’re subtracting 1 from amountToLower here. Is this it?

I don’t believe this to be the case; I had a print within there telling me amountToLower was at 0, but my humanoid’s jump power was at 49 instead of 50.

Maybe it’s a floating point error, although I can’t see it being one.

So supposedly, 50 - 0 is actually becoming 49.99… and roblox is somehow rounding that to 49?

I am not sure…
But I think your Original is 49 (with a floating-point).
Some properties may look round in the properties, but they are actually not. Such as WalkSpeed.

I think the script might round the number to the integer (same number without floating point), which might be different than the property editor.

In Java, when you convert a double (floating point), to an integer, it’s the same number without the floating-point (such as 49.999999999 → 49). It might be the same in Lua

As I said above, I am absolutely unsure about this, but it is worth testing. Try to print Original, and see if it’s 49.99999 or something.
You can also try to use math.floor() on Original and see if it becomes 49.

Edit: I joined your game, seems to be working as intended. It starts at 50, and lowers by 2 every jump.

I had tried changed original to 50 and despite that, it still becomes 49. Honestly very confused at this point.

I tested with print and they both come out as 50 each time. Very confused like I said.