1 vector swap(float x, float y) {
3 // everyone knows this trick
28 print("commutative\n");
31 if (x ^ (y ^ z) == (x ^ y) ^ z)
32 print("assocative\n");
34 // elements are their own inverse?
40 // are legal in constant expressions (currently)
41 const vector v3 = '5 2 5' ^ '3 10 3';
42 const vector v4 = '5 2 5' ^ 10;
44 print("vv: ", vtos(v3), "\n");
45 print("vf: ", vtos(v4), "\n");
47 // good olde xor swap test too
50 vector swaps = swap(swap_x, swap_y);
51 print("100:200 swapped is: ", ftos(swaps.x), ":", ftos(swaps.y), "\n");