Leo Li's answer provides a translation, but your question seems more about using
dr as a boolean when it's a "float":
I don't know what "dr ?" means because it's just a float and not a true/false value.
dr really is a number,
dr ? x : y will evaluate to
dr is not
0 and not
More generally: Any time a value is used in a condition (whether it's the conditional operator as in your question, or
if (value), or
while (value), etc.), any falsy value coerces to
false and any truthy value coerces to
true. The falsy values are
undefined, and of course,
false; all other values are truthy.