View Single Post
Re: need your advice on clock()
Old
  (#11)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: need your advice on clock() - 14-01-2004

clock() does not return unsigned longs, hence the rollover is fixed to LONG_MAX and can't be changed. It's the RETURN TYPE of the clock() function which determines the rollover, not the capacity of the variable I put it in.

And in this function the type "double" was used only to provide a greater floating-point computation accuracy, but this extra precision is not needed in the return type, since converting the results to float do not truncate any data at all. The precision was only needed during the computations.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote