From 6723f7137a3b2ec8c2a69e82ef704c671efffa24 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Mon, 11 Nov 2013 16:48:14 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11015 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- doc/variable.html | 6 ++++++ doc/variable.txt | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/doc/variable.html b/doc/variable.html index 1e11913bc3..9d59274487 100644 --- a/doc/variable.html +++ b/doc/variable.html @@ -415,6 +415,12 @@ precedence. Parenthesis can be used to group one or more portions of a formula and/or enforce a different order of evaluation than what would occur with the default precedence.

+

IMPORTANT NOTE: Because a unary minus is higher precedence than +exponentiation, the formula "-2^2" will evaluate to 4, not -4. This +convention is compatible with some programming languages, but not +others. This behavior can be overridden with parenthesis; the formula +"-(2^2)" will evaluate to -4. +

The 6 relational operators return either a 1.0 or 0.0 depending on whether the relationship between x and y is TRUE or FALSE. For example the expression x<10.0 in an atom-style variable formula will diff --git a/doc/variable.txt b/doc/variable.txt index ad11cc0b27..ed65e836a7 100644 --- a/doc/variable.txt +++ b/doc/variable.txt @@ -415,6 +415,12 @@ precedence. Parenthesis can be used to group one or more portions of a formula and/or enforce a different order of evaluation than what would occur with the default precedence. +IMPORTANT NOTE: Because a unary minus is higher precedence than +exponentiation, the formula "-2^2" will evaluate to 4, not -4. This +convention is compatible with some programming languages, but not +others. This behavior can be overridden with parenthesis; the formula +"-(2^2)" will evaluate to -4. + The 6 relational operators return either a 1.0 or 0.0 depending on whether the relationship between x and y is TRUE or FALSE. For example the expression x<10.0 in an atom-style variable formula will