Posted on 14 March 2009, 9:49 am, by klenwell, under
Code Case.
Problem
What if I need to compare really big numbers in PHP? Like comparing 2^66 > 3^53?
Overview
This will work:
print (int) (pow(2,66) > pow(3,53));
PHP will convert the integers to scientific notation. But this script illustrates the limitation of normal operational syntax (i.e.: pow(2,66) > pow(3,53) vs. bccomp(bcpow(2,66), bcpow(3,53),1) > 0):
$max = 1000;
foreach ( range(1,$max) as [...]
Posted on 3 March 2009, 8:53 pm, by klenwell, under
Miscellany.
This guide explains how to configure Ubuntu so that you can send email from the command line using mailx with your Gmail account for delivery. This updates a guide I originally posted on the ubuntu forums for mailx, which is part of the current Ubuntu repositories (versions 7 and 8). To use nail, [...]
Posted on 2 March 2009, 9:39 pm, by klenwell, under
Miscellany.
This will be the first of two posts showing you how to configure the more recent versions of Ubuntu to send email from the command line as simply as humanly possible using your Gmail account for delivery. These instructions were originally posted on my old blog and on the Ubuntu forums site.
This guide covers [...]