[Bioperl-l] Problems with Bioperl-ext package on WinVista?

Chris Fields cjfields at illinois.edu
Sun Aug 16 15:42:50 UTC 2009


On Aug 16, 2009, at 10:07 AM, Hilmar Lapp wrote:

>
> On Aug 16, 2009, at 1:38 AM, Chris Fields wrote:
>
>> I'm assuming this needs to simply be rounded up to 1.0.  That could  
>> be accomplished with something like 'if (sprintf("%.2f", $sum) !=  
>> 1.0) {...}'
>
>
> Couldn't you just test for the absolute difference being smaller  
> than some reasonable epsilon? That might be more efficient (and more  
> explicit) than printing to a string.
>
> 	-hilmar

Yes, either way is fine.  Re: floating point and sprintf, acc. to the  
perlfaq4, as perl doesn't have a round() function the sprintf() idiom  
is suggested (and commonly used).

chris



More information about the Bioperl-l mailing list