mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Add DIVRK test for vectors and also change variable names in VM for consistency
This commit is contained in:
parent
776f2f7bc3
commit
dcae3d4824
2 changed files with 6 additions and 4 deletions
|
@ -1859,8 +1859,8 @@ reentry:
|
|||
else if (ttisvector(rb))
|
||||
{
|
||||
const float* vb = rb->value.v;
|
||||
float vc = cast_to(float, nvalue(kv));
|
||||
setvvalue(ra, vb[0] / vc, vb[1] / vc, vb[2] / vc, vb[3] / vc);
|
||||
float nc = cast_to(float, nvalue(kv));
|
||||
setvvalue(ra, vb[0] / nc, vb[1] / nc, vb[2] / nc, vb[3] / nc);
|
||||
VM_NEXT();
|
||||
}
|
||||
else
|
||||
|
@ -2733,9 +2733,9 @@ reentry:
|
|||
}
|
||||
else if (ttisvector(rc))
|
||||
{
|
||||
float vb = cast_to(float, nvalue(kv));
|
||||
float nb = cast_to(float, nvalue(kv));
|
||||
const float* vc = rc->value.v;
|
||||
setvvalue(ra, vb / vc[0], vb / vc[1], vb / vc[2], vb / vc[3]);
|
||||
setvvalue(ra, nb / vc[0], nb / vc[1], nb / vc[2], nb / vc[3]);
|
||||
VM_NEXT();
|
||||
}
|
||||
else
|
||||
|
|
|
@ -64,6 +64,8 @@ end
|
|||
assert(vector(1, 2, 4) / 8 == vector(1/8, 1/4, 1/2));
|
||||
assert(vector(1, 2, 4) / (1 / val) == vector(1/8, 2/8, 4/8));
|
||||
assert(vector(1, 2, 4) / '8' == vector(1/8, 1/4, 1/2));
|
||||
assert(vector(1, 2, 4) / 8 == vector(1/8, 1/4, 1/2));
|
||||
assert(1 / vector(1, 2, 4) == vector(1, 1/2, 1/4));
|
||||
|
||||
assert(-vector(1, 2, 4) == vector(-1, -2, -4));
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue