From e2b2976d185fb4caab31578817da30ae1fc1ecbb Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Wed, 31 May 2023 18:30:26 -0700 Subject: [PATCH] document that * operator has has a higher precedence than << --- CHANGES | 4 ++++ help/unexpected | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 4eb4ad0..ddad5c7 100644 --- a/CHANGES +++ b/CHANGES @@ -20,6 +20,10 @@ The following are the changes from calc version 2.14.1.5 to date: Fixed obsolete references to the atoq() in LIBRARY to use the correct internal function name of str2q(). + Document in help/unexpected that * operator has has a higher + precedence than << in calc, which differs from C. Thanks + goes to GitHub user @inguin for pointing put this difference. + The following are the changes from calc version 2.14.1.3 to 2.14.1.4: diff --git a/help/unexpected b/help/unexpected index 244649f..8c845a0 100644 --- a/help/unexpected +++ b/help/unexpected @@ -556,8 +556,14 @@ Unexpected ; print sin(d2r(30)) 0.5 + * operator has has a higher precedence than << + ============================================== -## Copyright (C) 1999-2007,2014,2017,2021 Landon Curt Noll + The * operator has has a higher precedence than <<, which differs from the C language. + So 3 << 2*5 evaluates to 3072 in C, whereas 3 << 2*5 evaluates to 60 in calc. + + +## Copyright (C) 1999-2007,2014,2017,2021,2023 Landon Curt Noll ## ## Calc is open software; you can redistribute it and/or modify it under ## the terms of the version 2.1 of the GNU Lesser General Public License