Vector3int16 corrections

Vector3int16 defines __unm

Vector3int16 defines the __unm operation, which returns a Vector3int16 with the negation of each of its components.

print(-Vector3int16.new(1,2,3) == Vector3int16.new(-1,-2,-3)) --> true

Vector3int16 allows multiplication by number

Vector3int16 allows multiplication by a number in addition to another Vector3int16.

print(Vector3int16.new(100,100,100)*Vector3int16.new(2,4,6) == Vector3int16.new(200,400,600)) --> true
print(Vector3int16.new(-100,100,-50)*4 == Vector3int16.new(-400,400,-200)) --> true

Vector3int16 allows division by number

Vector3int16 allows division by a number in addition to another Vector3int16…

print(Vector3int16.new(100,100,100)/Vector3int16.new(2,4,6) == Vector3int16.new(50,25,16)) --> true
print(Vector3int16.new(-100,100,-50)/4 == Vector3int16.new(-25,25,-12)) --> true

Vector3int16 division rounding clarification

The results of the division will always be rounded down.

The result of a division rounds towards zero.

print(Vector3int16.new(-100,100,-50)/8 == Vector3int16.new(-13,12,-7)) --> false
print(Vector3int16.new(-100,100,-50)/8 == Vector3int16.new(-12,12,-6)) --> true
4 Likes