std: fix an infinite loop in num::ToPrimitive and add tests
auto merge of #9757 : erickt/rust/master, r=alexcrichton

I accidentally left an infinite loop in a default method in `num::ToPrimitive::to_u64()`. This fixes it.
Fix float to float ToPrimitive implementation.

The mimimum (negative) value of a float is -Bounded::max_value(), not Bounded::min_value().