Reimar Grabowski schrieb:
The parameter should default to FALSE to not break existing code relying on FPCs random function
And what about existing code coming from Delphi/Turbo Pascal? This was a strong argument in the past for doing even crap coding.



As the fast random function then has to be called with random(x, true)
I think this would be the best solution: Add an additional parameter to random() so that existing code would stop on compiling and the user has to look up the help to see what this additional parameter means. Then everybody is forced to choose the version that fits for his needs.

But having the same function doing something different (or at a magnitude different speed) is the wrong way IMO. Just imagine that divisions suddenly need 500 times the time because the last digit was inaccurate or so. In many cases the error is not relevant in your programs but the speed penalty surely would.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to