Re:Unsupervised translation of programming languages
by lunixbochs on Tuesday June 09, 2020 @10:33PM
(#23473301)
memset() is bytewise, the only reason it works with -1 is all the bits are set in every bit width. 0xff repeated still ends up being -1 at int size (0xffffffff). But the byte 0x2a repeated will be something more like 0x2a2a2a2a, which is not equivalent to 0x2a.
[ Parent
| on HN ]
Re:Unsupervised translation of programming languages
by Animats on Wednesday June 10, 2020 @01:47AM
(#23474340)
Right. So the translation was idiomatic but wrong.