Return-Path: X-Original-To: apmail-openoffice-dev-archive@www.apache.org Delivered-To: apmail-openoffice-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4361918E52 for ; Mon, 12 Oct 2015 19:59:01 +0000 (UTC) Received: (qmail 82655 invoked by uid 500); 12 Oct 2015 19:59:01 -0000 Delivered-To: apmail-openoffice-dev-archive@openoffice.apache.org Received: (qmail 82576 invoked by uid 500); 12 Oct 2015 19:59:00 -0000 Mailing-List: contact dev-help@openoffice.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openoffice.apache.org Delivered-To: mailing list dev@openoffice.apache.org Received: (qmail 82565 invoked by uid 99); 12 Oct 2015 19:59:00 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Oct 2015 19:59:00 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 1F6AA180A64 for ; Mon, 12 Oct 2015 19:59:00 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.427 X-Spam-Level: ** X-Spam-Status: No, score=2.427 tagged_above=-999 required=6.31 tests=[HK_RANDOM_ENVFROM=0.626, HK_RANDOM_FROM=1, KAM_ASCII_DIVIDERS=0.8, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id Co41B5c7UrYa for ; Mon, 12 Oct 2015 19:58:47 +0000 (UTC) Received: from mail1.vodafone.ie (mail1.vodafone.ie [213.233.128.43]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id E278920C18 for ; Mon, 12 Oct 2015 19:58:46 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhMQAOcPHFZtTIsh/2dsb2JhbABdgyaBQqkfCAUBgQ2HFIxngTcXgnyCCnUGAgICgTdMAQEBAQEBgQuEJgEBAQMBTjALCAMNCy4xJg4HBAEcBIgFDAHAH4YshUWEWjoXhBcFhzyOTQqICYUJiTKSWWOBSoI5PTMHhmoBAQE Received: from unknown (HELO 100AkerWood) ([109.76.139.33]) by mail1.vodafone.ie with SMTP; 12 Oct 2015 20:58:39 +0100 Date: Mon, 12 Oct 2015 20:58:39 +0100 From: Rory O'Farrell To: dev@openoffice.apache.org Subject: Re: [API] Priority Problem with AND and OR Message-Id: <20151012205839.9d2633db5e9e69a64c1468cf@iol.ie> In-Reply-To: <6f82f188c9370f89340fb07b5978701a@xaox.net> References: <561C0C9D.1090300@gmx.net> <6f82f188c9370f89340fb07b5978701a@xaox.net> X-Mailer: Sylpheed 3.5.0beta3 (GTK+ 2.24.27; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Mon, 12 Oct 2015 15:45:16 -0400 Andrew Pitonyak wrote: > Yes, I note this travesty in OOME. There is also a difference in the=20 > way that it handles exponentiation. Standard rules indicate that 2^3^4=20 > is evaluated as 2^(3^4) rather than (2^3)^4, wihch is what OOo does. This problem came up recently several times on the en-Forum; we advised tha= t it is best to use the brackets to define order of calculation (particular= ly as so many Calc users are mathematically inexperienced). It would never= theless be good to have the matter correct in some revision. Rory O'Farrell=20 > On 12.10.2015 15:40, Mathias R=F6llig wrote: > > Hello! > > > > I stumbled into a priority problem with the boolean operators AND and > > OR. I cannot find any documentation for this. > > > > First mathematical examples. > > > > With > > MsgBox( 3 * 2 ^ 2 ) > > you will see, that ^ has a higher priority than *. > > (2 ^ 2) =3D 4 > > 4 * 3 =3D 12 > > With > > MsgBox( (3 * 2) ^ 2 ) > > you will get the right result 6 ^ 2 =3D 36. > > > > With > > MsgBox( 3 + 4 * 3 ) > > you will see, that * has a higher priority than +. > > (4 * 3) =3D 12 > > 3 * 12 =3D 36 > > With > > MsgBox( (3 + 4) * 3 ) > > you will get the right result 7 * 3 =3D 21. > > > > Now looking at the same logic with logical operators. > > > > Dim bResult As Boolean > > bResult =3D TRUE Or FALSE And TRUE > > MsgBox( bResult ) > > bResult =3D TRUE Or TRUE And FALSE > > MsgBox( bResult ) > > > > What do you expect? > > For logical operations AND is equivalent to * and OR is equivalent to=20 > > +. > > AND should have a higher priority than OR, so I would expect in both > > cases (because TRUE Or () =3D TRUE): > > bResult =3D TRUE > > But you will get > > TRUE Or FALSE And TRUE =3D (TRUE Or FALSE) And TRUE =3D TRUE > > TRUE Or TRUE And FALSE =3D (TRUE Or TRUE) And FALSE =3D FALSE > > > > Is there any explanation that AND and OR have (and should have) the > > same priority? > > > > Regards, Mathias > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org > > For additional commands, e-mail: dev-help@openoffice.apache.org >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org > For additional commands, e-mail: dev-help@openoffice.apache.org >=20 >=20 --=20 Rory O'Farrell --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org For additional commands, e-mail: dev-help@openoffice.apache.org