home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!jvnc.net!news.edu.tw!news!Uz.nthu.edu.tw!yfwu
- From: yfwu@Uz.nthu.edu.tw (EE U780935)
- Subject: Re: OVERFLOW ERROR with Double in VB
- Message-ID: <1992Nov6.011700.17728%yfwu@Uz.nthu.edu.tw>
- Organization: National Tsing Hua University (HsinChu)
- References: <9211042127.AA24137@top.magnus.acs.ohio-state.edu>
- Date: Fri, 6 Nov 1992 01:17:00 GMT
- Lines: 26
-
- salter@magnus.acs.ohio-state.edu (John E Salter) 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
- >
- I think this is *not* a bug in Visual Basic. Because the Double data format
- is Sign+Exp+Mantessa. If we OR two Double number, the result is useless and
- meaningless. So if you really want to perform 2 8-byte number OR/AND/Other
- boolean operation. Use Currency instead.
- --
- ===============================================================================
- Yuh-Fuu Wu National Tsing-Hua University
- e-mail: yfwu@uz.nthu.edu.tw Dept. of Electric Engineering
- Hsin-Chu City, 300
- Like MS Visual Basic most! Taiwan, ROC
- ===============================================================================
-