Re: [Algorithms] Converting floats to a specific range
Brought to you by:
vexxed72
From: Richard F. <ra...@gm...> - 2010-05-07 15:29:24
|
I don't "know", but MOD is meant to be remainder on computers. It flummoxed me as I came from a more mathematical background and MOD is defined as not having negative numbers in the number field stuff On 7 May 2010 13:35, Danny Kodicek <dr...@we...> wrote: > There's a standard C library function, fmod, that nearly does what you > > want. The one thing you need to fix is that fmod(x, wrapSize) is > > negative whenever x is. So the solution to your problem is > > > A quick unlurk - I've often wondered why mod functions always seem to do > this. Can anyone explain that? I can think of very few occasions when you > want to take the mod of a number and not restrict it to a single range, > rather than maintaining the positive or negative value. I understand that > doing it this way makes the function faster, but given that you usually have > to override it anyway that would seem a bit of a meaningless saving. > > Danny > >> >> > > > ------------------------------------------------------------------------------ > > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list > -- fabs(); Just because the world is full of people that think just like you, doesn't mean the other ones can't be right. |