Re: Fraction to integer.

2001-10-18 Thread Juan Ramon
Joel R Stout wrote: > print " rand: $p \n"; > print "int: $q \n"; > print " ceil: $r \n"; > print " floor: $s \n"; > > if ( $p - $s >= .5 ){ > $t = $r > } else { > $t = $s > } > print "rounded: $t\n"; Another novice's 2 [euro] cents: $round = ($number>0)?floor($number+.5):ceil(

RE: Fraction to integer.

2001-10-18 Thread Stout, Joel R
PROTECTED]] Sent: Thursday, October 18, 2001 2:31 PM To: [EMAIL PROTECTED] Subject: Re: Fraction to integer. In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Amit Joshi) wrote: > Is there a way in perl to directly convert a fractional number to > its nearest integer value ?? use t

Re: Fraction to integer.

2001-10-18 Thread _brian_d_foy
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Amit Joshi) wrote: > Is there a way in perl to directly convert a fractional number to > its nearest integer value ?? use the int() function. http://www.perldoc.com/perl5.6.1/pod/func/int.html -- brian d foy <[EMAIL PROTECTED]> - Perl ser

Re: Fraction to integer.

2001-10-18 Thread Michael Fowler
On Thu, Oct 18, 2001 at 08:57:40PM +, Amit Joshi wrote: > Is there a way in perl to directly convert a fractional number to > its nearest integer value ?? See perldoc -q round. Michael -- Administrator www.shoebox.net Programmer, System Administrator www.gallanttech.c

RE: Fraction to integer.

2001-10-18 Thread Bob Showalter
> -Original Message- > From: Amit Joshi [mailto:[EMAIL PROTECTED]] > Sent: Thursday, October 18, 2001 4:58 PM > To: [EMAIL PROTECTED] > Subject: Fraction to integer. > > > Hi, > > Is there a way in perl to directly convert a fractional number to > its

Fraction to integer.

2001-10-18 Thread Amit Joshi
Hi, Is there a way in perl to directly convert a fractional number to its nearest integer value ?? Thanks, Amit. _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- To unsubscribe, e-mail: [EMAIL PRO