let as_int x = match extract x with Num f -> int_of_float f | _ -> failwith "as_int"