Xform and floats

Why do the following print commands produce different results?

float $location[] = xform -q -t -ws;
print($location[0] + " " + $location[1] + " " + $location[2] + "n");
print($location);

For example, when executed on a single mesh vertex:
-0.4999999925 0.4999999925 -0.4999999925
-0.5
0.5
-0.5

I know what its doing, but I don't know why. What I would like to do is have control of the float precision, like .499 would be great.

Thanks,

-Ben

your first print statement is concatenating the float array into a single string, and printing it, so it's all on one line. The second print statement is printing the actual array, so it prints each array element on a new line. My guess is that when converting it to a string, the decmil point accuracy is greater than when when printing an array.... but that's just a guess. Anyway, I bet they're actually the same values, just being displayed differently because one has been converted to a string, and one is left as a float array. Still, it is an interesting "feature" you've found... I hope someone else has a less 'wishy-washy' reply....