fizzbuzz-c icon indicating copy to clipboard operation
fizzbuzz-c copied to clipboard

fizzbuzz120.c and fizzbuzz121.c require at least 31-bit int

Open sheumann opened this issue 6 years ago • 1 comments

fizzbuzz120.c and fizzbuzz121.c use the expression 3 << (i%15*2) and evaluate it with various values of i which give shift counts of up to 28. In order for this to work without invoking undefined behavior, int (the type of the expression) must have a width of at least 31 bits. This requirement should probably either be noted in portability.md or removed (e.g. by changing 3 to 3L).

sheumann avatar Feb 07 '20 01:02 sheumann

i am changing the code and its successfully run

SUJATA19-could avatar Sep 27 '20 12:09 SUJATA19-could