[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: fwd: [office-comment] Comment on test case for LEFT()
Hi, Forwarding a mail from the comment-list. The LEN() part of that testcase should be removed anyway, but what about the fractional argument passed as position to the LEFT() function? Brad argues that (here implicit) conversion to int should be the testcase of the INT() function only. Opinions? Eike ----- Forwarded message from Brad Hards <bradh@frogmouth.net> ----- Date: Thu, 21 Dec 2006 12:46:49 +1100 Subject: [office-comment] Comment on test case for LEFT() From: Brad Hards <bradh@frogmouth.net> To: office-comment@lists.oasis-open.org Message-id: <200612211246.57640.bradh@frogmouth.net> Section 6.19.10 "Left" has this test case: Expression: =LEN(LEFT("xxx";-0.1)) Result: Error Level: 1 Comment: It makes no sense to request a negative number of characters. Length is converted using INT, towards negative infinity, so Length becomes -1 That is a bit subtle, and doesn't just test LEFT(). In particular, it will fail if the implicit conversion goes to 0 instead of -1. Suggest that the expression should be: =LEFT("xxx";-1) which would just test LEFT. Brad ----- End forwarded message ----- -- Automatic string conversions considered dangerous. They are the GOTO statements of spreadsheets. --Robert Weir on the OpenDocument formula subcommittee's list.
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]