Hi Hugo, On Fri, Nov 21, 2025 12:57 PM, Chris Brandt wrote: > On Fri, Nov 21, 2025 12:02 PM, Hugo Villeneuve wrote: > > > Pieces of code are reused all the time. So I think it is better to > > > make sure it doesn't overflow on 32-bit. > > > > Here is a potential idea for implementing it so that it doesn't overflow. > > I tested it (compile and run) on a 32-bit platform, and also with my RZG2L > board. > > Note that I defined an intermediate variable to improve readability > (extal_hz): > > I just started looking at this too. > > I think the existing code is more complicated than it needs to be. > All we want is a simple quotient (intin) and remainder (fracin). > > Let me try out your code with different boards and resolutions and see if it > matches the excel sheet I use to verify all the math/registers. > > If it's the same, then I'll put it in V6 (which is ready to go as soon as we > fix this last part)
I tested your code, and it works well! I'll use it. Thank you, Chris
