Closed NoahBres closed 3 years ago
Never mind. I was wondering if this was an error in NanoHTTPD
itself so googled the error and the first result was a previously closed issue but on the quickstart repo instead :P
https://github.com/acmerobotics/road-runner-quickstart/issues/22
For anyone stumbling upon this in the future, the issue isn't caused by a standalone field. Case 2 actually works fine. It just casts to a zero. It's caused by kV dividing by GEAR_RATIO
(which was casted to zero) resulting in an infinity value. Primary issue was ambiguity in the source of the error and neglecting to isolate the problem in its own repo.
The app will throw the following error when doing integer division on a double field:
I was able to reliably reproduce that error with the following two cases:
Obviously, case 1 is expected to throw that error. As would any division by zero. But I'm not sure why any integer division throws an error. I would think that in case 2, it evaluates 1/3 using integer division, resulting in zero, and then casting that to a double. Clearly, I don't know enough about Java's type coercion or reflection system but I would assume the second case would just result in a double zero value?