Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Find range in coordinates array

by jdporter (Canon)
on Sep 30, 2019 at 18:26 UTC ( #11106883=note: print w/replies, xml ) Need Help??


in reply to Find range in array with indices

7.23 is considered bigger than 7.133 (however, in terms of coordinates the opposite is the truth)

Can you explain this? How is 7.23 not bigger than 7.133?

And what should happen when the given number isn't in any of the ranges?

Replies are listed 'Best First'.
Re^2: Find range in coordinates array
by Fletch (Chancellor) on Sep 30, 2019 at 18:44 UTC

    I'm not sure I'm reading the OP right but I think that their list of numbers is really [start,end] pairs encoded as decimals. "7.23" means the range from character 7 to character 23, which is contained in the range [7,133]. Probably needs to split the string representation into pairs (maybe in an array ref) and then use an in_range( $range, $start, $end ) sub to check.

    Or something . . . </handwave>

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2019-11-18 09:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (89 votes). Check out past polls.

    Notices?