home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / mswindo / programm / misc / 3315 < prev    next >
Encoding:
Text File  |  1992-11-09  |  1.7 KB  |  37 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!jvnc.net!news.edu.tw!news!Uz.nthu.edu.tw!yfwu
  3. From: yfwu@Uz.nthu.edu.tw (EE U780935)
  4. Subject: Re: OVERFLOW ERROR with Double in VB
  5. Message-ID: <1992Nov6.011700.17728%yfwu@Uz.nthu.edu.tw>
  6. Organization: National Tsing Hua University (HsinChu)
  7. References: <9211042127.AA24137@top.magnus.acs.ohio-state.edu>
  8. Date: Fri, 6 Nov 1992 01:17:00 GMT
  9. Lines: 26
  10.  
  11. salter@magnus.acs.ohio-state.edu (John E Salter) writes:
  12. > What am doing wrong to cause the OVERFLOW ERROR.
  13. > If it is a VB problem, is there a work around?
  14. > I am trying to do logical ORing of bits in double numbers.
  15. >     Dim tbits As Double
  16. >     Dim sbits As Double
  17. >     Dim wbits As Double
  18. >     sbits = 0
  19. >     tbits = 2 ^ 36              'This statement is OK
  20. >     form1.Print sbits           'This is OK
  21. >     form1.Print tbits           'This is OK
  22. >     wbits = sbits Or tbits      'Produces OVERFLOW ERROR
  23. >     form1.Print sbits Or tbits  'Produces OVERFlOW ERROR
  24. I think this is *not* a bug in Visual Basic. Because the Double data format
  25. is Sign+Exp+Mantessa. If we OR two Double number, the result is useless and
  26. meaningless. So if you really want to perform 2 8-byte number OR/AND/Other
  27. boolean operation. Use Currency instead.
  28. --
  29. ===============================================================================
  30.  Yuh-Fuu Wu                                      National Tsing-Hua University
  31.  e-mail: yfwu@uz.nthu.edu.tw                     Dept. of Electric Engineering
  32.                                                  Hsin-Chu City, 300
  33.  Like MS Visual Basic most!                      Taiwan, ROC
  34. ===============================================================================
  35.