Ask a Question related to PHP Development, Design and Development.
-
Ted Huntington #1
fwrite int or float
Is there some easy way to fwrite a 32 bit int or float?
--
Ted Huntington
Programmer Analyst I
Main Library
University of California, Irvine
PO Box 19557
Irvine, CA 92623-9557
Phone Bus Off 949 824 8926
Phone MRC 949 824 1674
emesg: [email]thunting@uci.edu[/email]
webpage: [url]http://business.lib.uci.edu/webpages/ted.htm[/url]
"Stop violence, teach science."
Ted Huntington Guest
-
fwrite() help needed
I am trying to write to a .rtf file form a php page. I can create a temp rtf file based on a template but i can only change one item on the page.... -
#25562 [Opn->Bgs]: Float to String to Float conversion error
ID: 25562 Updated by: helly@php.net Reported By: daseymour at 3hc dot org -Status: Open +Status: ... -
#25562 [NEW]: Float to String to Float conversion error
From: daseymour at 3hc dot org Operating system: and PHP version: 4.3.3 PHP Bug Type: Math related Bug description: Float... -
Is fwrite atomic or not?
I've seen answers both ways in the archive of this list, and I wonder what is true. Suppose I open a file in append mode - like a log file. Two... -
fwrite problem
Hi all, I am writing a small script which will run on solaris. I want to get the IP address and write it to a file log.dat. File is created fine... -
Ted Huntington #2
Re: [PHP] fwrite int or float
ok I see to use the "pack" command, but now how do I format to 32 bit
little endian?
Ted Huntington wrote:
--> Is there some easy way to fwrite a 32 bit int or float?
>
> --
> Ted Huntington
> Programmer Analyst I
> Main Library
> University of California, Irvine
> PO Box 19557
> Irvine, CA 92623-9557
>
> Phone Bus Off 949 824 8926
> Phone MRC 949 824 1674
> emesg: [email]thunting@uci.edu[/email]
> webpage: [url]http://business.lib.uci.edu/webpages/ted.htm[/url]
> "Stop violence, teach science."
>
> --
> PHP General Mailing List ([url]http://www.php.net/[/url])
> To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
Ted Huntington
Programmer Analyst I
Main Library
University of California, Irvine
PO Box 19557
Irvine, CA 92623-9557
Phone Bus Off 949 824 8926
Phone MRC 949 824 1674
emesg: [email]thunting@uci.edu[/email]
webpage: [url]http://business.lib.uci.edu/webpages/ted.htm[/url]
"Stop violence, teach science."
Ted Huntington Guest
-
Ted Huntington #3
Re: [PHP] fwrite int or float
I should have type "signed 32 bit little endian" and little endian float.
Ted Huntington wrote:
--> ok I see to use the "pack" command, but now how do I format to 32 bit
> little endian?
>
> Ted Huntington wrote:
>>> > Is there some easy way to fwrite a 32 bit int or float?
> >
> > --
> > Ted Huntington
> > Programmer Analyst I
> > Main Library
> > University of California, Irvine
> > PO Box 19557
> > Irvine, CA 92623-9557
> >
> > Phone Bus Off 949 824 8926
> > Phone MRC 949 824 1674
> > emesg: [email]thunting@uci.edu[/email]
> > webpage: [url]http://business.lib.uci.edu/webpages/ted.htm[/url]
> > "Stop violence, teach science."
> >
> > --
> > PHP General Mailing List ([url]http://www.php.net/[/url])
> > To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
> --
> Ted Huntington
> Programmer Analyst I
> Main Library
> University of California, Irvine
> PO Box 19557
> Irvine, CA 92623-9557
>
> Phone Bus Off 949 824 8926
> Phone MRC 949 824 1674
> emesg: [email]thunting@uci.edu[/email]
> webpage: [url]http://business.lib.uci.edu/webpages/ted.htm[/url]
> "Stop violence, teach science."
>
> --
> PHP General Mailing List ([url]http://www.php.net/[/url])
> To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
Ted Huntington
Programmer Analyst I
Main Library
University of California, Irvine
PO Box 19557
Irvine, CA 92623-9557
Phone Bus Off 949 824 8926
Phone MRC 949 824 1674
emesg: [email]thunting@uci.edu[/email]
webpage: [url]http://business.lib.uci.edu/webpages/ted.htm[/url]
"Stop violence, teach science."
Ted Huntington Guest
-
Ted Huntington #4
Re: [PHP] fwrite int or float
I basically solved this problem of writing a 32 bit float in little endian on
a big endian computer using:
$num2=pack("f",$num);
fwrite($fp,$num2[3],1);
fwrite($fp,$num2[2],1);
fwrite($fp,$num2[1],1);
fwrite($fp,$num2[0],1);
for floating point (I am working on a UNIX [big endian] making a file for i86
[little endian]).
The more info, the better, perhaps some body else will search and find this
if ever the need.
Ted Huntington wrote:
--> I should have type "signed 32 bit little endian" and little endian float.
>
> Ted Huntington wrote:
>>> > ok I see to use the "pack" command, but now how do I format to 32 bit
> > little endian?
> >
> > Ted Huntington wrote:
> >> >> > > Is there some easy way to fwrite a 32 bit int or float?
> > >
> > > --
> > > Ted Huntington
> > > Programmer Analyst I
> > > Main Library
> > > University of California, Irvine
> > > PO Box 19557
> > > Irvine, CA 92623-9557
> > >
> > > Phone Bus Off 949 824 8926
> > > Phone MRC 949 824 1674
> > > emesg: [email]thunting@uci.edu[/email]
> > > webpage: [url]http://business.lib.uci.edu/webpages/ted.htm[/url]
> > > "Stop violence, teach science."
> > >
> > > --
> > > PHP General Mailing List ([url]http://www.php.net/[/url])
> > > To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
> > --
> > Ted Huntington
> > Programmer Analyst I
> > Main Library
> > University of California, Irvine
> > PO Box 19557
> > Irvine, CA 92623-9557
> >
> > Phone Bus Off 949 824 8926
> > Phone MRC 949 824 1674
> > emesg: [email]thunting@uci.edu[/email]
> > webpage: [url]http://business.lib.uci.edu/webpages/ted.htm[/url]
> > "Stop violence, teach science."
> >
> > --
> > PHP General Mailing List ([url]http://www.php.net/[/url])
> > To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
> --
> Ted Huntington
> Programmer Analyst I
> Main Library
> University of California, Irvine
> PO Box 19557
> Irvine, CA 92623-9557
>
> Phone Bus Off 949 824 8926
> Phone MRC 949 824 1674
> emesg: [email]thunting@uci.edu[/email]
> webpage: [url]http://business.lib.uci.edu/webpages/ted.htm[/url]
> "Stop violence, teach science."
>
> --
> PHP General Mailing List ([url]http://www.php.net/[/url])
> To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
Ted Huntington
Programmer Analyst I
Main Library
University of California, Irvine
PO Box 19557
Irvine, CA 92623-9557
Phone Bus Off 949 824 8926
Phone MRC 949 824 1674
emesg: [email]thunting@uci.edu[/email]
webpage: [url]http://business.lib.uci.edu/webpages/ted.htm[/url]
"Stop violence, teach science."
Ted Huntington Guest
-
Curt Zirzow #5
Re: [PHP] fwrite int or float
* Thus wrote Ted Huntington (thunting@uci.edu):
There was a large discussion on this about two weeks ago, check the> I basically solved this problem of writing a 32 bit float in little endian on
> a big endian computer using:
> $num2=pack("f",$num);
> fwrite($fp,$num2[3],1);
> fwrite($fp,$num2[2],1);
> fwrite($fp,$num2[1],1);
> fwrite($fp,$num2[0],1);
>
> for floating point (I am working on a UNIX [big endian] making a file for i86
> [little endian]).
>
> The more info, the better, perhaps some body else will search and find this
> if ever the need.
archives on 'big endian'
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
Curt Zirzow Guest



Reply With Quote

