#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    19
    Rep Power
    0

    In case of disaster


    From a technical point of view, which means from the viewpoint of a properly partitioned Linux system and the hardware it runs on, what would happen if you did this:

    >>>a = 1; while a > 0; a += 1

    Assume, for argument's sake, that you never hit ctrl-c or otherwise took steps to interrupt execution of that line of interactive code.
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,931
    Rep Power
    481
    This will run forever. Python2 uses, (as I recall) machine representation until it overflows, then continues with extended precision. Python3 makes no distinction, but otherwise you cannot tell the difference. Answered in an inebriated state.
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo