79543392

Date: 2025-03-29 14:44:25
Score: 1
Natty:
Report link

TL;DR

The grid size here is supposed to be a power of two as explained in the codelab itself.

-------------------------

Details

From what I can tell, part of the reason why this does not produce the expected output grid-sizes other than 2^n is due to the modulo (%) operation involving the floating point.

Doing f32(my_u32) % my_f32 gives a different result from using two f32(my_u32%my_u32)

The conversion in the first code-line may yield the wrong number in certain cases, and the right number for powers of 2 only.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Filler text (0.5): -------------------------
  • Low reputation (1):
Posted by: raymond