as.numeric with special handling for length 0 (NULL) objects
## S3 method for class 'nonempty' as.numeric(x)
x
the object to cast as numeric
value of type double