473,395 Members | 1,558 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,395 software developers and data experts.

Unsigned datatype

Hi

When do we use unsigned data type. And what are the adantages of using
Unsigned.
Jun 27 '08 #1
3 1358
pr****************@gmail.com wrote:
When do we use unsigned data type.
When dealing with non-negative integers, e.g. object
sizes (size_t), and particularly when performing bitwise
manipulations.
And what are the adantages of using Unsigned.
Bure binary representation and modulo arithmetic.

--
Peter
Jun 27 '08 #2
On 21 Apr, 06:27, Peter Nilsson <ai...@acay.com.auwrote:
prashant.khade1...@gmail.com wrote:
When do we use unsigned data type.

When dealing with non-negative integers, e.g. object
sizes (size_t), and particularly when performing bitwise
manipulations.
ie. ><< | & ^ ~

And what are the adantages of using Unsigned.

Bure binary representation and modulo arithmetic.
unsigned values don't overflow they simply wrap around.

unsigned u = 0;
u -= 1;

u now holds the largest possible unsigned int.
--
Nick Keighley

Jun 27 '08 #3
In article <b1**********************************@y18g2000pre. googlegroups.com>,
pr****************@gmail.com <pr****************@gmail.comwrote:
>When do we use unsigned data type.
Any day -except- the second Thursday or fifth Friday of the month.
The second Thursday is kept in memory of the death of George Boole
(Thursday Dec 8 1864); and the fifth Friday is when the
Regional Alamgamated Philisophers And Programmers hold their
meetings in pubs everywhere.
>And what are the adantages of using
Unsigned.
It's like a membership badge; if you don't know how to use unsigned
arithmetic then you don't get told where the next RAPAP meeting is.
--
"Do diddle di do,
Poor Jim Jay
Got stuck fast
In Yesterday." -- Walter De La Mare
Jun 27 '08 #4

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

Similar topics

6
by: Monica Roman | last post by:
Hello everyone, My question is how to upload an unsigned integer so that it looks like an IP address in Oracle? A Perl program captures IP addresses from a log server and puts them into a .csv...
8
by: Eternally | last post by:
Hi folks, I've got a program which has a function which uses templates to accept parameters of any type. Works well, but there's one certain datatype which I want to special case and do an...
0
by: SoYouKnowBrig | last post by:
Hi All, I am using Microsoft.ApplicationBlocks.Cache.CacheManager to persist a System.Data.Dataset object. This Dataset object has a DataTable that is created from an existing DataTable using...
2
by: Rahul | last post by:
Hi, I have a little program as follows : =================== STARTS HERE ================ #include <stdio.h> void f (unsigned long); int main() {
3
by: Sri | last post by:
In VB, to know the field type of a column stored in a recordset the command I use is If rsQuery.Fields(k).Type = adCurrency Then How will I achieve the same in ASP.net. I could not find a...
4
by: Orchid | last post by:
How can I change a Date datatype to a Number datatype? For example, I want a date 10/31/2006 to show 1031 as Number datatype. But I don't want it becomes 39021. What formula should I use? ...
5
by: oliver.andrich | last post by:
Hi, can anybody with ctypes experience tell me, how to handle a C function that returns an unsigned char*? Obviously it is not a restype of c_char_p. Best regards, Oliver
17
by: Tarique | last post by:
This program was compiled on MS Visual C++ 08 /*Fibonacci Numbers*/ #include<stdio.h> #include<limits.h> void fibonacci(int n) { unsigned long long fib0 = 0; /*First Fibonacci Number*/
5
by: Richard Harnden | last post by:
Hi, I've got a list of longs which I need to fix. Basically the numbers come from an unsigned long, which will wrap back to zero. I need them unwrapped. Also, my data will come from a...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.