Compound indexes with continuous numeric fields as the prefix

Can MongoDB create compound indexes using continuous numeric fields as the prefix?

For example:

db.col.createIndex({height_to_weight_ratio: 1, income_to_expense_ratio: 1})

As I understand it, a compound index works with categorical data because for each categorical value in the prefix there are multiple values in the sufix fields that fall under that category.

If a real number is to serve as the prefix, then the field that follows may only have one or a few values that fall under this real number. So I don’t understand how a compound index can be constructed if the prefix is a field that holds continuous real numbers.