473,770 Members | 6,322 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to handle big numbers (n x 32 bits)

51 New Member
Hi!!!!!!!!!!!!! !!!!!!!

Please I want to know how to create a variable of 64 bits, and this variable must allow functionality for their shifting. Thanks for your help

Best Regards,
Aug 14 '06 #1
9 4211
candexis
51 New Member
Hi Banfa, Thanks for your help, I apreciated, well regarding one of my Question about permutation you told me that for the 64 bits variable I must declare it using the followin instruction, long long K, the thing is that Microsoft Visual c++ does not allow me to do it this way, so could you please tell me how to create this variable, so I can use shifting?
Aug 14 '06 #2
Banfa
9,065 Recognized Expert Moderator Expert
That is platform dependent so we can't help without knowing the platform.
Aug 14 '06 #3
Banfa
9,065 Recognized Expert Moderator Expert
use

__int64

on microsoft (I may have the number of _ wrong check the help/header files).
Aug 14 '06 #4
candexis
51 New Member
So this is intended to be use in both plataform Linux and Windows. Thanks for your help
Aug 14 '06 #5
Banfa
9,065 Recognized Expert Moderator Expert
on Linux use

long long

on Windows use

__int64
Aug 14 '06 #6
candexis
51 New Member
So this is intended to be use in both plataform Linux and Windows. Thanks for your help
Aug 14 '06 #7
Banfa
9,065 Recognized Expert Moderator Expert
Oh and note

long long does not guarantee 64 bits in fact just that

sizeof(long long) >= sizeof(long)

it is just usual for it to be 64 bits.
Aug 14 '06 #8
Banfa
9,065 Recognized Expert Moderator Expert
And please reply to posts when talking about the same subject don't create new threads :-)
Aug 14 '06 #9
candexis
51 New Member
Thanks for your help, now I Know how.
Aug 14 '06 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

6
3496
by: cylin | last post by:
Hi all, If I have a variable and it's just have 22 bits, and I must set this variable unsigned integer. This 2's complement value maybe is negative. For example: A= 11 1111 1111 1110 1100 0000 = 4193984 3 f f e c 0 A's 2's complement should be
3
6054
by: Fred Hebert | last post by:
I am trying to use a 3rd party DLL that requires the main window handle as a parameter. e.g. MyFunc(WHND MyHandle); The example looks something like this: Result = MyFunc(Handle); Where "Handle" is the Win32 handle.
10
1517
by: Eric | last post by:
I have an array that contains over 30000+ bits. The size varies at runtime. I need to move through this chunk of memory and count bits every so often. Example: First 9 bits has 2 ones, next 10 bits has 4 ones, next 9 bits has 8 ones ... I know the number of bits that need to be counted at runtime only. But I do know it will be two different lengths that are consecutive numbers, it could be just one length but that will be rare. I...
3
2218
by: julry | last post by:
I need to compute factorials, but I hit a limit around 170!. Is there anyway to handle numbers larger than the float data type can handle? Thanks.
28
4818
by: MLH | last post by:
The largest integer A97 can deal with is 2,147,483,647, as I understand it from HELP. I would be content to represent larger integers as strings. For example, "2147483648" would suit me fine. I would be interested in converting larger HEX numbers to decimal integer equivalents. For example, a 16-digit HEX number is quite a large decimal value and I would be happy to represent it as a string, as it would suit my purposes fine. Since the...
17
12794
by: Sri | last post by:
How do you add an n-bit number in C? Regards, Sri
29
3279
by: Halid Umar A M | last post by:
Hi All, I m Halid Umar, network security research student. I will explain my situation and give me hint if you can. I expect reply from you all. * I have to handle numbers that have more than 64 bit like 128bit in cryptography applications. * For example, if i want to add two 128 bit numbers what should i do in C.
39
4020
by: Frederick Gotham | last post by:
I have a general idea about how negative number systems work, but I'd appreciate some clarification if anyone would be willing to help me. Let's assume we're working with an 8-Bit signed integer, and that it contains no padding. Firstly, I realise that the MSB is known as the sign-bit, and that it indicates whether the number is positive or negative (irrespective of which negative number system is used).
15
4854
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?
14
8662
by: thehobbit | last post by:
Hi, Could anyone give ideas on how to add 4 20 digit numbers in ANSI C and pass the result back to a calling program in COBOL? We were able to add up to 15 digit numbers without any problems, but we started facing issues once we go above 15 digits. Thanks, Venkat
0
9591
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10225
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9867
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8880
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6676
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3969
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3573
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.