Renchi Raju writes:
> what is wrong with casting the right hand side expressions'
> floating point literals to the precision of the left hand side
> variable and do it ONLY for the floating point literals.
What is wrong is that it isn't even close to what you actually want
to do. This is a hugely complicated subject and that kind of
simplistic approach is pretty much a non-starter. For the
most trivial possible example, consider
x = f(1.23)
where f is a function. I hope you don't think that, just because
f is invoked in a context like this, that you have even a clue as to
what kind of arguments f expects? And to make the assumption that it
expects different kinds depending on whether it's argument is a
literal or not? No. That just isn't even a viable starting place
for a workable solution. You can start making one exception and
special case after another, but in the end, I don't think you can
get where you want to go from there. "Solutions" that only work
for particular styles of expressions don't have much chance.
--
Richard Maine | Good judgment comes from experience;
[log in to unmask] | experience comes from bad judgment.
| -- Mark Twain
|