How to list all the prime factor?
0 votos
November 2nd, 2006 mysurface Posted in Calculation, cut, factor | Hits: 10096 |
Are you thinking of using c/c++ or bash script to do that? Don’t do that, linux have ready made command. Its call factor.
Let say I want to list the prime factor for 232.
factor 232
The result will be
232: 2 2 2 29
What if I want only the factor with the “232:” ? We can use cut with -complement.
factor 232 | cut -f1 -d" " --complement
By specifying -f1 -d” “, it suppose to extract column 1, but because I ask it for complement, I get this:
2 2 2 29
Live Chat!









Leave a Reply