Converts to not-nullable double
static double toDouble(dynamic d, double def) { return toDoubleN(d) ?? def; }