Switch and case statements normally require that the control expression be of type integer. Assume we wish to generalize a switch statement to allow control expressions and case labels that are floating point values. For example, we might have
Would you recommend a jump table translation, or a search table translation, or is some new approach required? How would you handle the fact that float ing point equality comparisons are "fuzzy" due to round off errors. (That is, sometimes what should be an identity relation, like sqrt(f)*sqrt(f) ==
f is false.)