Answer: yes and no. The length must be less than 5.
But there is a practical limit to how the width is calculated.
So No.. This solution is not completely viable.
Step-by-step explanation: If the length is almost 4, for example, the width must be between a bit more than 0 and less than or equal to 1. Using x<5 -5 to compute the width is not viable.