<div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 24, 2020 at 6:38 AM Daniele Nicolodi <<a href="mailto:daniele@grinta.net">daniele@grinta.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)" dir="auto">On 24/11/2020 10:25, Thomas wrote:<br>
> Like Nathaniel said, it would not improve much when compared to the<br>
> modulo operator. <br>
> <br>
> It could handle the edge cases better, but really the biggest benefit<br>
> would be that it is more convenient.<br>
<br>
Which edge cases? Better how?<br>
<br>
> And as the "unwrap" function already exists,<br>
<br>
The unwrap() function exists because it is not as trivial.<br>
<br>
> people would expect that<br>
> and look for a function for the inverse operation (at least I did).<br>
<br>
What is your use of a wrap() function? I cannot think of any.<br>
<br>
Cheers,<br>
Dan<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)" dir="auto"></blockquote><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">For what it’s worth, this kind of range reduction can be extremely nontrivial depending on the needs of your application. Look at the efforts needed to ensure that the trigonometric functions give good results. This is discussed in this paper: <div dir="auto"><a href="https://www.csee.umbc.edu/~phatak/645/supl/Ng-ArgReduction.pdf">https://www.csee.umbc.edu/~phatak/645/supl/Ng-ArgReduction.pdf</a>.</div><div dir="auto"><br></div><div dir="auto">I don’t think that this belongs in Numpy, but it certainly isn’t a one liner. </div><div dir="auto"><br></div><div dir="auto">Best,</div><div dir="auto"><br></div><div dir="auto">Eric</div><div dir="auto"><br></div><div dir="auto"><br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)" dir="auto"><br></blockquote></div></div>