Re: RFC - Two more Math packages: Math_Integer and Math_Fibonacci

From: Date: Fri, 03 Jan 2003 00:06:36 +0000
Subject: Re: RFC - Two more Math packages: Math_Integer and Math_Fibonacci
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-12050@lists.php.net to get a copy of this message
--- Xavier Noguer <xnoguer@rezebra.com> wrote: > > I tried the tests in testMath_Fibonacci.php and they didn't work for me. It > seems gmp_init() doesn't like strings representing non-integers (I'm using > GMP 4.0.1). Hmm. I had not test w/ GMP 4.0.1 but w/ the 2.* lib on my home computer. Will install 4.x in my computer here (Solaris) and retest. Tnxs for the info. > If I change line 90 on Integer.php from: > $this->_value = gmp_init(strval($num)); > to: > $this->_value = gmp_init(strval(round($num))); > It works. That will only work if the string being passed is float-like decimal. Might not work if you are passing an hexadecimal. I think a simple regex before the assignment should help fix that. > > Am I missing something here? > > Oh, and +1 for both packages ===== --- Jesus M. Castagnetto (jcastagnetto@yahoo.com) Research: http://metallo.scripps.edu/ Personal: http://www.castagnetto.org/ __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com

« previous php.pear.dev (#12050) next »