pub fn cmp_bignum(lhsb: &BigInt, rhs: Value) -> Option<std::cmp::Ordering> {
    use std::cmp::Ordering::*;
    if let Some(_) = rhs.as_fixnum() {
        if lhsb.is_positive() {
            Some(Greater)
        } else {
            Some(Less)
        }
    } else if let Some(rhsf) = rhs.as_float() {
        if rhsf.is_infinite() {
            if rhsf == f64::INFINITY {
                Some(Less)
            } else if rhsf == f64::NEG_INFINITY {
                Some(Greater)
            } else {
                unreachable!()
            }
        } else {
            lhsb.to_f64().unwrap().partial_cmp(&rhsf)
        }
    } else if let Some(rhsb) = rhs.as_bignum() {
        lhsb.partial_cmp(&rhsb)
    } else {
        None
    }
}
Compare `lhsb` to `rhs` (`lhsb` <=> `rhs`).

# Examples

```
# use ruruby::*;
# use ruruby::arith::*;
# use num::bigint::BigInt;
# use std::cmp::Ordering::*;
let big =  BigInt::from(2i64).pow(100u32);
let big_prev: BigInt = big.clone() - 1;
let big_next: BigInt = big.clone() + 1;
assert_eq!(cmp_bignum(&big, Value::bignum(big.clone())), Some(Equal));
assert_eq!(cmp_bignum(&big, Value::bignum(big_prev.clone())), Some(Greater));
assert_eq!(cmp_bignum(&big, Value::bignum(big_next.clone())), Some(Less));

assert_eq!(cmp_bignum(&big, Value::float(f64::INFINITY)), Some(Less));
assert_eq!(cmp_bignum(&big, Value::float(f64::NEG_INFINITY)), Some(Greater));
```
ruruby/src/arith.rs