mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-10-30 23:15:32 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			477 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			477 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
| _G.core = {}
 | |
| dofile("builtin/common/math.lua")
 | |
| 
 | |
| describe("math", function()
 | |
| 	it("round()", function()
 | |
| 		assert.equal(0, math.round(0))
 | |
| 		assert.equal(10, math.round(10.3))
 | |
| 		assert.equal(11, math.round(10.5))
 | |
| 		assert.equal(11, math.round(10.7))
 | |
| 		assert.equal(-10, math.round(-10.3))
 | |
| 		assert.equal(-11, math.round(-10.5))
 | |
| 		assert.equal(-11, math.round(-10.7))
 | |
| 		assert.equal(0, math.round(0.49999999999999994))
 | |
| 		assert.equal(0, math.round(-0.49999999999999994))
 | |
| 	end)
 | |
| end)
 |