Puzzle - RPL and others
|
05-11-2021, 02:14 PM
Post: #39
|
|||
|
|||
RE: Puzzle - RPL and others
(05-11-2021 11:58 AM)Albert Chan Wrote: Without typecast, it may already be broken with left shift 31That would be sign-extension. I typedef'd bitset_t to be unsigned long long, which should as an unsigned type receive zero-extension instead. Anyway, a shift of 31 only occurs when the base hits 33, and since 33 (as an odd number) is treated with an early exit, the program would run into the undefined result of a shift by 32 at the same time (starting from base=34). Perhaps I should've picked a more forgiving language for the port to a more powerful platform, like, say, Haskell ... C is certainly happy to stab you in the back when you treat it wrong. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)