Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bittest question
Message
 
 
To
12/07/2018 13:27:59
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01661094
Message ID:
01661133
Views:
33
>>>>>Your integers have only 32 bits, numbered from 0 to 31. You overstepped.
>>>>>
>>>>>(and this is not the bittest question in the world - I've seen bitter...)
>>>>
>>>>I suppose that this function cannot be applied to BigInt type, which if I understand correctly, has 64 bits. No?
>>>
>>>VFP doesn't do 64 bit integers. If such a number is encountered, it is automatically converted as IEEE float, with standard 15,5 significant digits.
>>
>>A follow up question, if you don't mind. Does it mean then, when using SQL Server as database for VFP application, using the Bigint type column does not make much sense? Since VFP only uses 32 bit integers.
>
>Assuming you have a need for such integers (I never had), the values you'd get in VFP may be too big to fit a 32 bit integer, so in a view/cursor you'd have to map it to something like a n(19,0) or whatever is the limit or necessary size. But then when you try to manipulate those numbers in variables, you'd run into the limitation of 32-bit IEEE floats, the 15,5 significant digits. Just try
>?1000000000000555+1000000000000555
>?10000000000000555+10000000000000555
>?100000000000000555+100000000000000555
>and you'll find that the result ends with 1110 in first two cases, but ends with 1100 in the last. That's that limitation, the lowest digits on the lower end get lost.
>
>So, the answer is the usual "it depends". This time, depends on what you need to do.

The only reason I was thinking of using big integers is that I thought I would be able to use them with Bittest() function. But, since Bitest() does not accept numbers greater than 31, I won't be using Bigint in SQL Server.
Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform