On Mon, 10 Nov 2014, Allin Cottrell wrote:
On Mon, 10 Nov 2014, Sven Schreiber wrote:
> Hi,
>
> example:
>
> <hansl>
> nulldata 10
> a = 3.5
> print sqrt(a) # prints workfile data instead
>
> matrix ma = {3.5}
> print sqrt(ma) # prints ma instead of root
> </hansl>
[ some discussion ]
The coercion of sqrt(3.5) = 1.8708287 to 1 for the purpose of
designating a list element is now disbarred in CVS. More generally,
if an argument of a built-in function is supposed to be an integer,
we'll accept only values that differ from an integer by less than
1.0e-8, and we'll round to the nearest integer rather than simply
truncating.
I think this should catch truly bad arguments (hence avoiding the
production of strange and unexpected results) without generating
spurious errors due to the inherent imprecision of floating-point
values.
All readers, please let me know if this causes trouble for things
that you reckon ought to work.
Allin