Order of operations - what is 6÷2(1+2) ?
|
12-23-2020, 03:14 AM
(This post was last modified: 12-23-2020 03:26 AM by robve.)
Post: #71
|
|||
|
|||
RE: Order of operations - what is 6÷2(1+2) ?
(12-22-2020 10:50 PM)Albert Chan Wrote:(12-22-2020 08:03 PM)robve Wrote: Yes for Prolog: I agree. Parsers should not consider the - to be part of the number to avoid this flaw. So it is ridiculously funny to see the following (note the spacing between - and 2): ?- X is -2^2. X = 4. ?- X is - 2^2. X = -4. On the other hand, SWI-Prolog has a reasonably powerful implementation of multi-precision arithmetic with bigint and rationals (bigint/bigint) https://www.swi-prolog.org/pldoc/man?section=arith something I contributed to to this project many years ago and now fully integrated. "I count on old friends" -- HP 71B,Prime|Ti VOY200,Nspire CXII CAS|Casio fx-CG50...|Sharp PC-G850,E500,2500,1500,14xx,13xx,12xx... |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)