Hi Rob,
The difference comes down to rounding of the very last digit in binary representation. It's interesting to use 'format hex' in this situation, which produces the IEEE 754 representation of a double precision number in 16 hexidecimal digits:
format hex
[ 3e-9;
3*1e-9;
3/1e9 ]
ans = 3e29c511dc3a41df
3e29c511dc3a41e0
3e29c511dc3a41df
So the second number is represented differently in the very last bit. Which is 'correct' is not real definitive. One way to see what might be 'correct' is multiplying / dividing the 1e-9 factor to get back to 3;
[ 3e-9;
3*1e-9;
3/1e9 ]*1e9
ans = 4008000000000000
4008000000000001
4008000000000000
[ 3e-9;
3*1e-9;
3/1e9 ]/1e-9
ans = 4008000000000000
4008000000000000
4008000000000000
By this criterion the 3*1e-9 representation is not as 'correct' as the other two, although when dividing by 1e-9 it's just as good as the other two. This example is just a sample of one, though, and could come out differently in other examples.
I think the real message here is not which one of these is better, but rather the old refrain,
don't make exact equality comparisons of floating point numbers unless they are known to be integers.