XOR, OR, AND Convert Floating Point to Integer (61434)
The information in this article applies to:
- Microsoft QuickBASIC 4.0
- Microsoft QuickBASIC 4.0b
- Microsoft QuickBASIC 4.5
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
- Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
- Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0
This article was previously published under Q61434 SUMMARY
The Basic bitwise operators (AND, OR, XOR, and NOT) do not operate
directly on floating-point numbers (SINGLE ! or DOUBLE #) or string
variables ($). They also do not operate directly on currency data type
numbers (@) in Microsoft Basic Professional Development System (PDS)
version 7.00. When a bitwise operation is attempted with a
floating-point variable that has a value greater than the maximum LONG
integer (2,147,483,647), an "Overflow" error occurs.
To properly perform a bitwise operation on a floating-point variable,
the floating-point number must be moved into a LONG using a bitwise
move. Two functions are listed below to move between SINGLEs and LONGs
so that bitwise operations can be used on SINGLE floating-point
numbers.
This information applies to Microsoft QuickBasic versions 4.00, 4.00b,
and 4.50, and Microsoft Basic Compiler versions 6.00 and 6.00b for
MS-DOS and MS OS/2, and Microsoft Basic PDS version 7.00 for MS-DOS
and MS OS/2.
Modification Type: | Minor | Last Reviewed: | 1/8/2003 |
---|
Keywords: | KB61434 |
---|
|