Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
changed that test. i ran the full tests a bunch of time with the reference solution and the user solution using different order of operations, and tests passed consistently, so these problematic cases should be exceedingly rare.
To avoid copying of a std::vector
What's the reason for changing the function signature?
Still got the same issue here in cpp
I think it also makes a difference if you calculate as w/(h*h) or w/h/h
The test cases should not sit on floating point boundary.
Almost a year later, still the same issue.
And actually, the test is not even an edge-case which causes weird floating point rounding in typical implementations. The test-case is actually simply wrong:
w = 86.7000000000000028421709430404007434844970703125
h = 1.6999999999999999555910790149937383830547332763671875
so w>86.7, h<1.7, so w/(h* h) > 86.7/(1.7^2) = 30. So Obese is actually correct, given the input.
There are a problem in C++ test with bmi = 30.0 when w = 86.7 and h = 1.7
The first two fixed tests and all random tests work correctly.
if you know how floating numbers work (in a binary system as well), then you'll know why computers can't accurately count some values.