OK, sounds good, but odd since a 16-bit value is far beyond the resolution an 8-bit PIC PWM channel can generate, which is at best 10-bit. It also depends on frequency, etc, so it is typically lower (8-bit is common)
I guess the function does some "magical" scaling to make FFFF essentially equal a 100% PWM duty-cycle.