Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Storing a number of power of 2 into INT field
Message
 
 
À
09/06/2017 11:16:15
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01651872
Message ID:
01651874
Vues:
56
>>If I store a number of power of 2 into INT field, how many different "values" will this field hold? I am not sure I phrase my question correctly, so here is an example of what I am trying to say.
>>Say I store 128 into a INT field. Which means that I can get 7 numbers: 2, 4, 8, 16, 32, 64, 128
>>Since an INT field can hold up to 2,147,483,647, what is the max number can I get from this value?
>
>The maximum value in regards to that calculation would be 1,073,741,824. That would be 2^30. If you go higher, you will be one number over the maximum. I would suggest to switch the field to Big Integer if you have some concerns.

This is about 1 billion. For what I am trying to do, this is more than enough. 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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform