I was told by a professor that dividing by zero or taking a negative square root in Python crashes if you do it in Windows 98.
This seems ridiculous since Python is an interpreted language, but I don't have a way to verify this, and Windows is notorious... Can anyone confirm or deny the claim? If so, does it have to do with the fact that Python is written in C? (And would C really crash the whole OS for division by zero!?)
It should result in a ZeroDivisionError
exception. I can't imagine why this would be different in Windows 98.
>>> 1/0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ZeroDivisionError: integer division or modulo by zero
What a remarkable waste of time.
Python 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
****************************************************************
Personal firewall software may warn about the connection IDLE
makes to its subprocess using this computer's internal loopback
interface. This connection is not visible on any external
interface and no data is sent to or received from the Internet.
****************************************************************
IDLE 1.0.5
>>> import sys
>>> sys.getwindowsversion()
(4, 10, 67766446, 1, ' A ')
>>> sys.version_info
(2, 3, 5, 'final', 0)
>>> 1/0
Traceback (most recent call last):
File "<pyshell#3>", line 1, in -toplevel-
1/0
ZeroDivisionError: integer division or modulo by zero
>>>
Python 2.7.2 (Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Joke)] on win98
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> math.sqrt(-1) / 0
A fatal exception 0E has occurred at 0028:C0011E36 in VXD VMM(01) +
00010E36. The current application will be terminated
* Press any key to terminate the current application.
* Press CTRL+ALT+DEL again to restart your computer. You will
lose any unsaved information in all applications
*disclaimer : Of course, I made that all up. I'm inclined to agree with tito on this one - a trolling professor is the most likely explanation!
░░░░░▄▄▄▄▀▀▀▀▀▀▀▀▄▄▄▄▄▄░░░░░░░
░░░░░█░░░░▒▒▒▒▒▒▒▒▒▒▒▒░░▀▀▄░░░░
░░░░█░░░▒▒▒▒▒▒░░░░░░░░▒▒▒░░█░░░
░░░█░░░░░░▄██▀▄▄░░░░░▄▄▄░░░░█░░
░▄▀▒▄▄▄▒░█▀▀▀▀▄▄█░░░██▄▄█░░░░█░
█░▒█▒▄░▀▄▄▄▀░░░░░░░░█░░░▒▒▒▒▒░█
█░▒█░█▀▄▄░░░░░█▀░░░░▀▄░░▄▀▀▀▄▒█
░█░▀▄░█▄░█▀▄▄░▀░▀▀░▄▄▀░░░░█░░█░
░░█░░░▀▄▀█▄▄░█▀▀▀▄▄▄▄▀▀█▀██░█░░
░░░█░░░░██░░▀█▄▄▄█▄▄█▄████░█░░░
░░░░█░░░░▀▀▄░█░░░█░█▀██████░█░░
░░░░░▀▄░░░░░▀▀▄▄▄█▄█▄█▄█▄▀░░█░░
░░░░░░░▀▄▄░▒▒▒▒░░░░░░░░░░▒░░░█░
░░░░░░░░░░▀▀▄▄░▒▒▒▒▒▒▒▒▒▒░░░░█░
░░░░░░░░░░░░░░▀▄▄▄▄▄░░░░░░░░█░░
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With