Re: building binary data structures

From: Date: Thu, 15 Feb 2001 23:24:37 +0000
Subject: Re: building binary data structures
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-40018@lists.php.net to get a copy of this message
> Having written loads of stuff in PHP, I find myself having for the first > time to generate binary data in memory - I actually need to build a native > file for a drawing program in memory. The data consists mainly of lists of > 32bit little endian integers - some signed and some unsigned. I've started > the work, and am building the data up in a string variable. I know however > that I am about to get bitten by numeric overflows. > > For example if I have a function create_thingy($param1,$param2) where param1 > is an unsigned 32 bit int, and the top bit is set, then I suspect that php > will probably represent the number as floating point, and I'll probably lose > some precision. > > Has anybody been here before and found a good mode of working in the > unsigned 32bit arena? BCMATH would work... If you're already messing around with using strings, you might as well use BCMATH. You now know as much about BCMATH as I do... -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm

« previous php.general (#40018) next »