home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!elroy.jpl.nasa.gov!usc!sol.ctr.columbia.edu!usenet.ucs.indiana.edu!silver.ucs.indiana.edu!bdwheele
- From: bdwheele@silver.ucs.indiana.edu (Brian Wheeler)
- Subject: Re: OVERFLOW ERROR with Double in VB
- Message-ID: <Bx8y3B.LLM@usenet.ucs.indiana.edu>
- Sender: news@usenet.ucs.indiana.edu (USENET News System)
- Nntp-Posting-Host: silver.ucs.indiana.edu
- Organization: Indiana University
- References: <9211042127.AA24137@top.magnus.acs.ohio-state.edu>
- Date: Thu, 5 Nov 1992 14:11:35 GMT
- Lines: 44
-
- In <9211042127.AA24137@top.magnus.acs.ohio-state.edu> John E Salter <salter@magnus.acs.ohio-state.edu> writes:
-
-
-
- >What am doing wrong to cause the OVERFLOW ERROR.
- >If it is a VB problem, is there a work around?
- >I am trying to do logical ORing of bits in double numbers.
-
-
- > Dim tbits As Double
- > Dim sbits As Double
- > Dim wbits As Double
- > sbits = 0
- > tbits = 2 ^ 36 'This statement is OK
- > form1.Print sbits 'This is OK
- > form1.Print tbits 'This is OK
- > wbits = sbits Or tbits 'Produces OVERFLOW ERROR
- > form1.Print sbits Or tbits 'Produces OVERFlOW ERROR
-
-
- >John Salter
- >salter.1@osu.edu
-
- Logical operators work only on integers. variables that are stored as Double
- have a format somthing like this:
- SEEEEEEEEEEMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
- where:
- S is the sign (1 bit)
- E is the exponent (10 bits)
- M is the mantissa (53 bits)
-
- (I may be a little off on the bit counts)
-
- so it doesn't make any sense to OR something with this because it isn't in a
- true binary number format.
- I suggest using LONG or INTEGER. LONG is 32 bits (I think) and INTEGER is 16
- bits, and both are signed.
-
- Hope this helps
- --
- ******************************************************************************
- * Brian 'Nautical' Wheeler - These are my opinions, do you hear me? MINE!
- * "Wombats are our friends" - Me
- ******************************************************************************
-