Results 1 to 2 of 2

Thread: Work this one out???

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2002
    Location
    SE England
    Posts
    732

    Talking Work this one out???

    Can someone please explain to me why sample code 1 results in a division by zero error, and sample code 2 results in an Overflow error?


    I Know that the code should result in an error, but why different errors????


    Sampe Code 1
    ===========
    Dim i As Integer

    i = 1

    i = i / 0
    ===========


    Sample Code 2
    ===========

    Dim i As Integer


    i = i / 0

    ===========
    Leather Face is comin...


    MCSD

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    well you are doing 2 different things..

    in case one ..you are dividing 1/0

    in case two...0/0

    its just that overflow is the error caught befor edivsion by zerro...of course not sure why that would give an overflow.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width