Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Decimals comparing ( < > ) incorrectly?!
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Jeepaholic
Average Member

USA
697 Posts

Posted - 20 August 2001 :  19:58:45  Show Profile  Visit Jeepaholic's Homepage
Well, I've racked my brain on this. For whatever reason, after a number of iterations of comparisions, the statistics code I'm writing for a different project starts comparing inaccurately.

The comparisons I'm doing are for integers, which I solved by doing a cint(integervalue), and for decimal numbers...which I've yet to figure out.

Basic comparisons (a < b) are coming out incorrectly...and I'm a bit at a loss for this. I guess I just don't understand enough as to what's going on with the numbers behind the scenes to figure this out.

Any thoughts?

Al Bsharah
Jeepaholics Anonymous

Doug G
Support Moderator

USA
6493 Posts

Posted - 20 August 2001 :  22:51:56  Show Profile
You may be overflowing a variable. For example, integers only count to 32K approx. Or you may be encountering rounding problems over multiple passes.

Here is a link to VBS datatype info:

http://msdn.microsoft.com/scripting/vbscript/doc/vbsdatatype.htm


======
Doug G
======
Go to Top of Page

davemaxwell
Access 2000 Support Moderator

USA
3020 Posts

Posted - 21 August 2001 :  08:04:21  Show Profile  Visit davemaxwell's Homepage  Send davemaxwell an AOL message  Send davemaxwell an ICQ Message  Send davemaxwell a Yahoo! Message
Like Doug said, you could be going over your max or having rounding problems. Also check that your numbers aren't null which will give you odd results.

For reference:

Integer(cint) - -32,788 to 32,787
Long (clng) - over 32,787
Double (cdbl) - Anything with decimals (has a high max, but can't remember which)

Dave Maxwell
--------------
Proud to be a "World Class" Knucklehead
Go to Top of Page

Jeepaholic
Average Member

USA
697 Posts

Posted - 23 August 2001 :  10:26:28  Show Profile  Visit Jeepaholic's Homepage
Thanks for the info, will dig into this. Definitely a probably cause...thanks!

Al Bsharah
Jeepaholics Anonymous
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.27 seconds. Powered By: Snitz Forums 2000 Version 3.4.07