Prime factor of 300 000 000 000?

前端 未结 19 743
无人及你
无人及你 2021-01-03 10:23

I need to find out the prime factors of over 300 billion. I have a function that is adding to the list of them...very slowly! It has been running for about an hour now and i

19条回答
  •  没有蜡笔的小新
    2021-01-03 11:01

    $ time factor 300000000000 > /dev/null
    
    real        0m0.027s
    user        0m0.000s
    sys         0m0.001s
    

    You're doing something wrong if it's taking an hour. You might even have an infinite loop somewhere - make sure you're not using 32-bit ints.

提交回复
热议问题