Chris Whittington wrote:Leaving out the fascinating topic of how many time control floats can you get on the head of a pin, the original purpose of this discussion was to debunk the Hyatt assertion that use of floats within time control was mad and/or bad and/or quirky and therefore a sign of copying. Since it is neither mad nor bad nor quirky and is used by several including Bob's own program, it would appear that it is no proof of anything.lmader wrote:Ok, that's all true. But maybe I'm losing the thread here, and if so I apologize, but isn't this all supposed to relate back to the code in Rybka that was comparing an int variable to a float const? That is not the same thing as what we are saying about using floats for intermediate steps in a computation. This is an example of an incorrect comparison. Or am I missing something?syzygy wrote:
Well, if you want to call this "integer code" I am fine with that. The point is that it is completely natural to start with integers, end with integers, but use floating point for intermediate calculations. Indeed there are two reasons for this: avoid overflows and preserve precision.
(Of course all of that CAN be done using ints only. In fact, internally a CPU does all floating point calculations in binary only.)
There is NO floats in my time control code. Which is the code that sets the target time, and measures the elapsed time and compares the delta (time used) to the target. ALL done in pure ints... Displaying a number in a way that is user-friendly (fractions of a second rather than some programs that just display time in 1/100th of a second ints (15 secs = 1500, for example) has absolutely nothing to do with time allocation and time decisions. How about sticking to the topic... This doesn't debunk anything except that the person that wrote the bench.c code (or rewrote it, actually) chose a different way to display NPS for reasons only he could answer. It was certainly unnecessary as we never show fractions of a NPS.