てきとう

てきとう

Adaにおける正負あり整数

type My_Integer is range -127..128;

みたいなやつ。範囲は当然両端を含む。
StandardにはIntegerとPositiveとNaturalが定義されている。実装に丸投げだけど。

type Integer is range implementation-defined;
type Natural is new Integer range 0..Integer'Last;
type Positive is new Integer range 1..Integer'Last;

ウチのGNATだとIntegerは32bitのようだ。