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.
OP solved it, closing
the C++ test case
(w = 86.7, h = 1.7)
was problematic because the orer of operations affected the result. removed.Marking as resolved since the author forgot to ;)
Thanks!
Hi Tadar, to convert from positive to negative in binary, using two's complement, you invert all bits, and then add 1.
It's just
-2**30
or so, which surely fits in C/C++int
.For reference:
-2**31 <= int < 2**31
What do you think it is, if not an
int
? And how can you get something other thanint
in a function acceptingint
?Thanks!
Which language? I'm not certain but the solutions may vary by language. Javascript has completely different tests in 3 and 6 place.
When you ask for help don't post an issue. Usually when you get unsupported type it is because there are errors in your code.
You must return the sum of the lowest positive numbers, not the lowest numbers. ;)
Floating-point rounding errors.
w/(h*h) first multiplies h and then divides w.
w/h/h first divides w and then divides it again.
The different setup of the operations can introduce little discrepancies that mess with direct floating-point comparisons.