document that * operator has has a higher precedence than <<

This commit is contained in:
Landon Curt Noll
2023-05-31 18:30:26 -07:00
parent 3ea51ea937
commit e2b2976d18
2 changed files with 11 additions and 1 deletions

View File

@@ -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 Fixed obsolete references to the atoq() in LIBRARY to use the
correct internal function name of str2q(). 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: The following are the changes from calc version 2.14.1.3 to 2.14.1.4:

View File

@@ -556,8 +556,14 @@ Unexpected
; print sin(d2r(30)) ; print sin(d2r(30))
0.5 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 ## 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 ## the terms of the version 2.1 of the GNU Lesser General Public License