Results 1 to 5 of 5

Thread: help with divide by zero error!!!

  1. #1
    Guest

    help with divide by zero error!!!

    i am making a cheap car game in VB (don't pay me out) and it works on my PC with win98 but when i send the compiled version to my friends with win98 they get the "divide by zero" error. it works fine in XP aswell.

    can anyone help with that?

  2. #2
    Member Contributor
    Join Date
    Jul 2000
    Posts
    60

    Re: help with divide by zero error!!!

    My recommendation is watch your divisions, if there is a case for divide by zero then handle it, don't just assume things will be well.

    ie.
    aspect = height / width;
    use this instead
    aspect = (width != 0.0) ? (height / width) : 0.0;

    Hope this helps, sorry I don't know VB so no VB code
    Neil

  3. #3
    Guest

    Re: help with divide by zero error!!!

    I am getting the same problem. My program works on all other computers except for a new one that I recently purchased.


    Originally posted by Darkside:
    i am making a cheap car game in VB (don't pay me out) and it works on my PC with win98 but when i send the compiled version to my friends with win98 they get the "divide by zero" error. it works fine in XP aswell.

    can anyone help with that?

  4. #4
    Senior Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    653

    Re: help with divide by zero error!!!

    Just a guess here but different os's handling floating point (near to zero) differently.... your machine may be happy with 0.1 * 10^-30 but others may flag this as divide by zero.

  5. #5

    Re: help with divide by zero error!!!

    Division by a floating-point zero won't cause an exception -- it will result in either +-INF or qNaN.

    Make sure that your friend has the same version of the runtime DLLs that you have. Is there some difference between your Windows 98 versions (SE, SP3, etc.)? Try to eliminate any variables.

    Also, with Visual C++, if you compile a program in Debug mode, all memory is initially striped (0xcdcdcdcd), but if you compile in release mode, all memory is initially zeroed (0x00000000). Visual BASIC may have similar behavior, so make sure that you initialize all variables before you use them (especially if you are running in Debug mode, and you sent your friend a Release executable).

Similar Threads

  1. Divide by zero
    By V-man in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 02-06-2013, 07:46 AM
  2. Divide by zero
    By dukey in forum OpenGL: GLSL
    Replies: 2
    Last Post: 12-30-2010, 11:09 AM
  3. Divide the code
    By Aquileo in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 12-04-2003, 06:13 AM
  4. "divide by zero" when using light
    By skorman00 in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 06-13-2003, 12:37 PM
  5. NV_evaluators and divide by zero error
    By Diapolo in forum OpenGL: Advanced Coding
    Replies: 9
    Last Post: 02-18-2002, 01:09 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean