|
From: Karl-Friedrich R. <mai...@gm...> - 2014-04-18 11:24:45
|
As gnuplot is not a programming language, i think changing the integer division behaviour is well permissible for a major version. And for those who, like myself, misuse gp for general data evaluation and programming, i´d just say "Suck it up!" ;-) One should however set up a few extra warnings (probably in the gp startup messages?), so everybody will catch up on it. I would like to have an explicit integer division symbol, like e.g. pascal "div". It´d be faster, could be overloaded to also accept a real divided/divisor, and just be syntactically clear. (btw., would it be possible to overload modulo "%" to also accept reals?) >>> I wonder if it is worth putting in special >>> code to detect division of two integer constants, and warn once per >>> session. (every evaluation would obviously be too often) > > I like this idea if we choose not to auto-promote. > > For those already aware, the warning would get annoying. There should > be a way to suppress the warning (by using int()?), and for that matter > probably a way to suppress all warnings. > The problem then persist: Most everybody sometimes forgets the dot after a number that is supposed to be a real, and then spends half an hour searching for the bug. Karl |