|
-
Jan 13th, 2015, 12:52 PM
#1
Thread Starter
Member
Preserve decimal precision in Bitwise Operation
I have a number that is a decimal , fractional number, less than 1000 in an array, EG: 518.25
Adding the value 1024 "Flags" this number as unique among the rest. To get to the original number I "And" it with 1023.
However, I lose the ".25" and get 518.
Code is as follows:
Dim N1 As Long
N1 = 518.25
MsgBox 1023& And (N1 + 1024&)
Produces "518"
Is there a way to retrieve the precision and get 518.25?
Thanks
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|