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

@@ -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