ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 2nd, 2004, 12:58 PM
javiwankenobi javiwankenobi is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 58 javiwankenobi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 42 sec
Reputation Power: 6
Angry Overflow when trying to divide :(

Hey, thanks for all of your helping in the past.....now im stuck on this one. Ok so this is what i have to do


F.E. = T - t
------ x100
T
where T = is the last operation's timing
t = is the first operation's timing

So i coded it all in one line like this:

Code:
Session("feugene") = ((Session("fop10")-Session("fop1"))/Session("fop10"))*100


And that returned "overflow" error... so i checked once and again and i couldnt find a mistake on a parenthesis or nothing like that. So i ended up doing it all step by step like this:

Code:
Session("feugene") = Session("fop10")-Session("fop1")
Session("feugene") = Session("feugene")/Session("fop10")
Session("feugene") = Session("feugene")*100 


and it's still saying i have an error on the line that refers to the division. I am using 'double' values on the inputs.. and i also tried to use the cdbl function before each variable and it wont work either. Does anyone have an idea of what's going on? Sorry if dumb post, but this is driving me nuts.. thanks

Reply With Quote
  #2  
Old April 2nd, 2004, 03:06 PM
ASP-Hosting.ca ASP-Hosting.ca is offline
Need hosting? I can help.
ASP Free Novice (500 - 999 posts)
 
Join Date: Sep 2003
Posts: 826 ASP-Hosting.ca User rank is Private First Class (20 - 50 Reputation Level)ASP-Hosting.ca User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 17 h 50 m 37 sec
Reputation Power: 7
Print the value of Session("fop10") with Response.Write and make sure it's not 0.

Reply With Quote
  #3  
Old April 2nd, 2004, 03:15 PM
spungebob spungebob is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Dover
Posts: 128 spungebob User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 39 sec
Reputation Power: 6
Smile Can not devide by zero!

Here is what I would try
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 7.0">
</HEAD>
<BODY>
<%

Session("fop1") = 0
Session("fop10") = -1
if Session("fop10") = 0 then
'can not divide by zero
session("feugene") = 0
Else
Session("feugene") = cdouble(Session("fop10"))-cdouble(Session("fop1"))
Session("feugene") = cdouble(Session("feugene"))/cdouble(Session("fop10"))
Session("feugene") = cdouble(Session("feugene"))*100
end if
Response.write session("feugene")
%>
</BODY>
</HTML>
<%
Public Function CDouble(value)
CDouble = 0.0

If VarType(value) = vbBoolean Then
If value Then
CDouble = 1.0
End If

Exit Function
End If

On Error Resume Next
CDouble = CDbl(value)
End Function
%>

Bob@lyrex.com

Reply With Quote
  #4  
Old April 2nd, 2004, 04:27 PM
javiwankenobi javiwankenobi is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 58 javiwankenobi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 27 m 42 sec
Reputation Power: 6
Thanks for your reply spungebob..
i capture the values of the variables with textfields, so i put the inputs
and none of the inputs are 0...

i still keep getting that error.. i feel like the dumbest person in the world!!! =(

Reply With Quote
  #5  
Old February 15th, 2005, 02:43 PM
cainechow cainechow is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 1 cainechow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 45 sec
Reputation Power: 0
I would like to give this thread a bump to the top because I am also having this problem.

For me, I have 2 variables which are sumations and have the following code:

Code:
  
dWinchCatTotalShiftsWorked = cdbl(dWinchCatTotalShiftsWorked) + cdbl(dValue) 
dWinchCatUtilizationTotalShiftsAvailable = cdbl(dWinchCatUtilizationTotalShiftsAvailable) + cdbl(rsDetails("ShiftsAvailable")) 


When I use response.write on these variables I get 6 and 8 respectively. When I response.write the TypeName of these variables, I get the value double for both.

Now, when I divide dWinchCatTotalShiftsWorked by dWinchCatUtilizationTotalShiftsAvailable as in the following:

Code:
Response.Write(dWinchCatTotalShiftsWorked/dWinchCatUtilizationTotalShiftsAvailable)
Response.Write(6/8)


I get the Microsoft VBScript runtime (0x800A0006) Overflow error.

The second statement works just fine and returns 0.75

Now how is it that division using the variables causes an overflow error? a CDbl should easily handle a value of 0.75

Ponderous man. Really ponderous.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > Overflow when trying to divide :(


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek