473,224 Members | 1,472 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 software developers and data experts.

is 128 bits the max?

I've written a script that uses bits to store permissions, however, once I go
over 128 bits I get an error:

System.OverflowException: Arithmetic operation resulted in an overflow.

Is this a limitation of the system?
Jul 22 '05 #1
3 1145
What do you use to store those bits ?

If you want to store more bits you'll have to use more bytes (AFAIK the .NET
framework has also a specialized class for this that could perhaps be
usefull).

Patrice

--

"P1ayboy" <P1*****@discussions.microsoft.com> a écrit dans le message de
news:9A**********************************@microsof t.com...
I've written a script that uses bits to store permissions, however, once I go over 128 bits I get an error:

System.OverflowException: Arithmetic operation resulted in an overflow.

Is this a limitation of the system?

Jul 22 '05 #2
Its ok thanks, I eventually re-cast them as integers and that seemed to solve
the problem.

"Patrice" wrote:
What do you use to store those bits ?

If you want to store more bits you'll have to use more bytes (AFAIK the .NET
framework has also a specialized class for this that could perhaps be
usefull).

Patrice

--

"P1ayboy" <P1*****@discussions.microsoft.com> a écrit dans le message de
news:9A**********************************@microsof t.com...
I've written a script that uses bits to store permissions, however, once I

go
over 128 bits I get an error:

System.OverflowException: Arithmetic operation resulted in an overflow.

Is this a limitation of the system?


Jul 22 '05 #3
In case you would like to give a further look, see the BitArray class...

Patrice

--

"P1ayboy" <P1*****@discussions.microsoft.com> a écrit dans le message de
news:17**********************************@microsof t.com...
Its ok thanks, I eventually re-cast them as integers and that seemed to solve the problem.

"Patrice" wrote:
What do you use to store those bits ?

If you want to store more bits you'll have to use more bytes (AFAIK the ..NET framework has also a specialized class for this that could perhaps be
usefull).

Patrice

--

"P1ayboy" <P1*****@discussions.microsoft.com> a écrit dans le message de
news:9A**********************************@microsof t.com...
I've written a script that uses bits to store permissions, however, once I
go
over 128 bits I get an error:

System.OverflowException: Arithmetic operation resulted in an

overflow.
Is this a limitation of the system?


Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Ben | last post by:
Hi, I need to write some data types into an array of unsigned chars. These are basically "signals" within a message, so each signal will have a start bit and a length. The signals will also...
40
by: aku | last post by:
I'm looking for the absolute fastest way to count the nr of bits that are set to "1" in a string. Presumably I then first need the fastest way to do this in a byte. I think this is it, but...
7
by: sathyashrayan | last post by:
Group, Following function will check weather a bit is set in the given variouble x. int bit_count(long x) { int n = 0; /* ** The loop will execute once for each bit of x set,
6
by: barcaroller | last post by:
I couldn't find a message-digest newsgroup, so I posted here. I have a C function that converts a string of arbitrary length to a 32-bit hash value. I realize this is overkill but I used...
5
by: Oyvind Eriksen | last post by:
Hello. I need to read bits from bytes in a file. I have code that works but it's very slow. Can anybody help me? The code I have is: private bool GetBit(byte b, int pos) { return ((b &...
15
by: steve yee | last post by:
i want to detect if the compile is 32 bits or 64 bits in the source code itself. so different code are compiled respectively. how to do this?
11
by: Mack | last post by:
Hi all, I want to write a program to count number of bits set in a number. The condition is we should not loop through each bit to find whether its set or not. Thanks in advance, -Mukesh
77
by: borophyll | last post by:
As I read it, C99 states that a byte is an: "addressable unit of data storage large enough to hold any member of the basic character set of the execution environment" (3.6) and that a byte...
11
by: JoeC | last post by:
I am working on a graphics program but my question has nothing to do with graphics but trying to get an algorithm to work. I set graphics from a 16x16 grid to bits of a graphic with: bitData =...
11
by: spasmous | last post by:
Just wondering.
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.