VectorA:round

From ComputerCraft Wiki
Revision as of 11:07, 23 February 2013 by MafiaMoe (Talk | contribs) (Created page with "Returns a vector with all components rounded to the nearest integer Code example: local a = vector.new(1.4999, 1.5, 3.14) local c = a:round() print(c.x) print(c.y) p...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Returns a vector with all components rounded to the nearest integer

Code example:

local a = vector.new(1.4999, 1.5, 3.14)

local c = a:round()

print(c.x)
print(c.y)
print(c.z)
--1
--2
--3