On 12 May 2016 at 17:32, Walter Bright via Digitalmars-d <[email protected]> wrote: > On 5/11/2016 2:24 AM, Manu via Digitalmars-d wrote: > >> The reason I'm wary about emitting a warning is because people will >> encounter the warning *all the time*, and for a user who doesn't have >> comprehensive understanding of floating point (and probably many that >> do), the natural/intuitive thing to do would be to place an explicit >> cast of the lower precision value to the higher precision type, which >> is __exactly the wrong thing to do__. >> I don't think the warning improves the problem, it likely just causes >> people to emit the same incorrect code explicitly. > > > The warning is intended for people who understand, as then they will figure > out what they actually wanted and implement that. People who randomly and > without comprehension insert casts hoping to make the compiler shut up > cannot be helped.
But they can easily be helped by implementing behaviour that makes sense. If you're set on a warning, at least make the warning recommend down-casting the higher precision term to the lower precision?
