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

How do we assign 16 bytes unsigned Integer in PHP?

We are unable to represent an unsigned integer with 16 bytes memory
size. The current integer size is 4 bytes by default. There is no way
for us to store large integer in this case.
The valid number range is from 0 to 2^128-1
(340282366920938463463374607431768211455).

Thank you.

Feb 7 '06 #1
5 4051
floats can store numbers up to 1.8x10^308, that should be enough

mk********@hotmail.com wrote:
We are unable to represent an unsigned integer with 16 bytes memory
size. The current integer size is 4 bytes by default. There is no way
for us to store large integer in this case.
The valid number range is from 0 to 2^128-1
(340282366920938463463374607431768211455).

Thank you.

Feb 7 '06 #2
mk********@hotmail.com wrote:
We are unable to represent an unsigned integer with 16 bytes memory
size. The current integer size is 4 bytes by default. There is no way
for us to store large integer in this case.
The valid number range is from 0 to 2^128-1
(340282366920938463463374607431768211455).

Thank you.


Hi,

What is your question?

How to use big numbers?

Try searching for bc at www.php.net.
It is all there. :-)

Regards,
Erwin Moller
Feb 7 '06 #3
doorman wrote:
floats can store numbers up to 1.8x10^308, that should be enough

mk********@hotmail.com wrote:
We are unable to represent an unsigned integer with 16 bytes memory
size. The current integer size is 4 bytes by default. There is no way
for us to store large integer in this case.
The valid number range is from 0 to 2^128-1
(340282366920938463463374607431768211455).
Thank you.


But they don't have the precision he needs.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Feb 7 '06 #4
Le Tue, 07 Feb 2006 09:07:24 +0100, <mk********@hotmail.com> a écrit:
We are unable to represent an unsigned integer with 16 bytes memory
size. The current integer size is 4 bytes by default. There is no way
for us to store large integer in this case.
The valid number range is from 0 to 2^128-1
(340282366920938463463374607431768211455).

Thank you.


Look at the bcmath extension (http://www.php.net/manual/en/ref.bc.php). It
provides arbitrary precision number arithmetics. You can even specify how
many decimal numbers you want.
Feb 7 '06 #5

"Jerry Stuckle" <js*******@attglobal.net> wrote in message
news:Nf********************@comcast.com...
doorman wrote:
floats can store numbers up to 1.8x10^308, that should be enough

mk********@hotmail.com wrote:
We are unable to represent an unsigned integer with 16 bytes memory
size. The current integer size is 4 bytes by default. There is no way
for us to store large integer in this case.
The valid number range is from 0 to 2^128-1
(340282366920938463463374607431768211455).
Thank you.

But they don't have the precision he needs.


I saw these from an earlier post. try these. it will work to any precision
you want.
If your host won't allow you to include these libraries, write a precision
math class. I did once.

http://fr2.php.net/manual/en/ref.gmp.php
http://us2.php.net/manual/en/ref.bc.php

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Feb 9 '06 #6

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

Similar topics

27
by: Daniel Lidström | last post by:
Hello! I want to work with individual bytes of integers. I know that ints are 32-bit and will always be. Sometimes I want to work with the entire 32-bits, and other times I want to modify just...
44
by: RB | last post by:
How to extract bytes from long, starting from the last byte? For example, I have a long number: 0x12345678 I need to represent it as the following bytes list: 0x78, 0x56, 0x34, 0x12 Thanks in...
19
by: Lorenzo J. Lucchini | last post by:
My code contains this declaration: : typedef union { : word Word; : struct { : byte Low; : byte High; : } Bytes; : } reg;
25
by: Allan Rydberg | last post by:
hi i'm trying to shift a double, but i'm getting the error message '>>' illegal, left operand double. althought that the manpages say, '>>' and '<<' can be applied for int's only, i was able...
34
by: john | last post by:
If I have a 32 bit unsigned int that is in the wrong byte order, how can I convert it? For example, if have a number 0x090a0b0c how can I reverse this to 0x0c0b0a09 ? Thanks, -John
0
by: darenceang | last post by:
Hi all. I have a PGM file. I am supposed to read in this file and find the pixel value for each pixel in the picture. Currently, i am reading UNSIGNED bytes. I got this function to covert it...
49
by: seema | last post by:
Hi all, How to calculate upper 4 bytes and lower 4 bytes of a value? Can somebody please explain?? say for example, unsigned int scnlen_lo; int scnlen_hi; unsigned long long scnlen; ...
1
by: freeurmind | last post by:
hello, i'm writing a function that translate Bytes of type unsigned char to integer array of 1's and 0's, i'm taking a message of 33 Bytes and translating them in an int array of 264 integers, here's...
33
by: Hahnemann | last post by:
Does anybody know the answer to the following? An unsigned short is 2 bytes long. Why is the following file created as 4 bytes instead of 2? file = fopen("data.bin", "wb"); if (file != NULL)...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
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,...

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.