division by zero issue ?

Post » Thu Jun 21, 2012 7:52 am

This would crash Oblivion:

Num3 = 0

Num = Num2 / Num3

and believe it or not even if you buried it under an if statement it would still crash:

Num3 = 0
if Num3 > 0
Num = Num2 / Num3
endif

So I had to do things like this:

Num = Num2 / Num3 + 0.001 :yuck:


So is this division by zero issue still a problem in Skyrim scripting or is there some built in protection (like in modern calculators) from this old OLD * programming issue.

* see here: http://en.wikipedia.org/wiki/Division_by_zero
User avatar
jaideep singh
 
Posts: 3357
Joined: Sun Jul 08, 2007 8:45 pm

Post » Thu Jun 21, 2012 6:52 am

Has nothing to do with anything, but here's an amusing story. My mom was on the team that designed the original ATM (some 30 years ago, with punch cards and everything) and one day they decided they wanted all the programmer's working for IBM to try to crash the First National Bank's computer system (a client of theirs for whom they were doing cyber security consulting).
My mom sat down at her desk, thought for a second or two, and then wrote a brief script that made it such that any money put in or out of the bank was automatically divided by 0.
It brought the Bank to a halt within seconds; she got employee of the month.
User avatar
renee Duhamel
 
Posts: 3371
Joined: Thu Dec 14, 2006 9:12 am

Post » Wed Jun 20, 2012 11:03 pm

:rofl:

Great story! :yes:

So I guess I will have to just make a /0 script bomb and test Skyrim, I was a little afraid to do that but what is the worse that can happen.... right?

Has nothing to do with anything, but here's an amusing story. My mom was on the team that designed the original ATM (some 30 years ago, with punch cards and everything) and one day they decided they wanted all the programmer's working for IBM to try to crash the First National Bank's computer system (a client of theirs for whom they were doing cyber security consulting).
My mom sat down at her desk, thought for a second or two, and then wrote a brief script that made it such that any money put in or out of the bank was automatically divided by 0.
It brought the Bank to a halt within seconds; she got employee of the month.
User avatar
noa zarfati
 
Posts: 3410
Joined: Sun Apr 15, 2007 5:54 am

Post » Thu Jun 21, 2012 7:10 am

you should incorporate it into a mod. the black door asks you a riddle in which you answer "Divide by zero, my brother"

then it takes you into The Void..... forever
User avatar
Robert Devlin
 
Posts: 3521
Joined: Mon Jul 23, 2007 2:19 pm

Post » Thu Jun 21, 2012 2:21 am

I haven't looked into the code or tested it but IMHO, the VM ought to be robust enough to deal with fundamental exceptions like FP and divide-by-zero errors.
User avatar
Taylah Illies
 
Posts: 3369
Joined: Fri Feb 09, 2007 7:13 am


Return to V - Skyrim