← Prev in month ← Prev in thread
Next in thread → Next in month →

RIGHT("hello"; -0.1) _should_ be a test case

From
David A. Wheeler <>
Date
2007-02-08T16:27:21+00:00
ID
Thread
RIGHT("hello"; -0.1) _should_ be a test case
Eike Rathke has proposed changing some test cases, and I intend to restore them back.  Here's my reasoning... but that doesn't make it right :-).  Eike, others, does my reasoning make sense?

One of the test cases is:
 =RIGHT("hello"; -0.1)
This tests two things: (1) does the function correctly convert to an integer using INT(), and (2) does it correctly produce an error when given a negative length?

Eike proposes changing to this:
 =RIGHT("hello"; -1)
Which would test #2, but not #1.  What I'm trying to prevent is implementations that use round-to-nearest or round-toward-zero semantics for LEFT/RIGHT/etc.... we should all use the same round-to-integer algorithm where we can gain agrement.

Sound okay?

--- David A. Wheeler
← Prev in month ← Prev in thread
Next in thread → Next in month →