home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.programming      Programming issues that transcend langua      57,431 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 56,645 of 57,431   
   David Brown to Ben Bacarisse   
   Re: A little puzzle.   
   21 Nov 22 22:06:07   
   
   From: david.brown@hesbynett.no   
      
   On 21/11/2022 21:45, Ben Bacarisse wrote:   
   > I wonder if there are any real posters here?  Let's see...   
   >   
   > I came across a trivial programming task that must have been solved a   
   > thousand times by other programmers, but it had never crossed my path   
   > until yesterday.  I must be feeling my age because I made a real hash of   
   > tackling it at first.  Anyway, I thought it might be of interest.   
   >   
   > Consider any ordered measure that "wraps round" -- bearings in degrees,   
   > minutes in the hour, indeed hours in either the 12 or 24 hour clock.   
   > The problem is to determine if a given value is in the sub-range   
   > specified by a start and an en value.   
   >   
   > I was specifically concerned with integer values where the sub-range   
   > includes the start value but excludes the end value.   
   >   
   > Though I am not sure this merits the term "puzzle", I suggest that   
   > solutions be posted with some spoiler protection.  Do all the news   
   > readers used by programmers (or ex programmers) all respect the presence   
   > of a form-feed character...   
   >    
   > ... like this?  Because that's my favourite way, rather than posting   
   > lots of dummy lines before the solution.   
   >   
      
   Are there any restrictions, such as sticking to integers?  The problem   
   becomes quite difficult if your measure is the reals in [0, 1) and your   
   "n" is, say, π/4...   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca