Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Calculate comparison between

by zwon (Monsignor)
on Jul 27, 2013 at 15:46 UTC ( #1046664=note: print w/ replies, xml ) Need Help??


in reply to Calculate comparison between

($second_beg>=($first_beg-5)) && ($first_beg<=($second_beg+5))
This is the same condition written in two different ways. I think you want something like this:
use List::Util qw(min max); ...; my $overlap = min($first_end, $second_end) - max($first_beg, $second_b +eg) + 1; if($overlap >= 5) { ... };


Comment on Re: Calculate comparison between
Select or Download Code
Re^2: Calculate comparison between
by Anonymous Monk on Jul 27, 2013 at 15:52 UTC
    Great thanks! Also I realised I was a bit lazy and did not look into Perlmonks older entries, so I found also many entries!
    Thank you very much!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1046664]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (11)
As of 2014-09-16 19:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (44 votes), past polls