Using the dot product and comparing it to 0 is a mathematical concept that does not translate well to floating point arithmetic. If you are going to use this method, unless you know for sure you are dealing with integers only and that the calculations will not overflow the precision, it is better to use a tolerance for floating point comparisons. And unless you know the range of numbers you are dealing with for picking a tolerance, you should normalize the columns before comparing the dot product result to the tolerance.
All that being said, what you could simply do to generate the dot products is do a matrix multiply with its transpose. E.g., A'*A will generate all of the column dot products as elements of the result. Just examine the upper or lower triangle part of this.