Is it possible to declare Ada range with unlimited upper bound?
问题 I would like to declare a speed range for a record type in Ada. The following won't work, but is there a way to make it work? --Speed in knots, range 0 to unlimited Speed : float Range 0.0 .. unlimited ; I just want a zero positive value for this number... 回答1: You can't -- but since Speed is of type Float , its value can't exceed Float'Last anyway. Speed : Float range 0.0 .. Float'Last; (You'll likely want to declare an explicit type or subtype.) 回答2: Just for completeness, you can also