Visual Basic Express 2005-overflowexception

Discussion in 'Software' started by Rollinscorp, Mar 29, 2008.

  1. Rollinscorp

    Rollinscorp Private E-2

    I am close to completing my project involving calculating various characteristics of an AC circuit. The project has to be done in Visual Basic 2005 express edition.
    The project works for most values but very large ones, with these I get overflow exception was unhandled. If I use the Try....catch method and insert a breakpoint in the catch section I can check the values and they appear within the bounds of the double data type eg 4.5441697049225575E+24

    scales = ((quantity \ 80) * 80) + 80
    This is the specific line which gets pulled up, both scales and quantity declared as double, quantity has, for example, the (calculated) value specified above.
    Scales is declared globally, quantity is declared locally.

    If I cannot solve this then I shall have to put limits on the inputs but this is undesirable.

    Any advice would be great!
     
  2. Assembler

    Assembler Private E-2

    try using floating point variables instead of the double type. or maybe an unsigned double.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds