473,387 Members | 1,492 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,387 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 1150
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.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.