comp.lang.ada
 help / color / mirror / Atom feed
* type definition for an integer with discrete range
@ 2019-03-29 16:10 mario.blunk.gplus
  2019-03-29 16:34 ` tranngocduong
  2019-03-30 21:45 ` John Perry
  0 siblings, 2 replies; 16+ messages in thread
From: mario.blunk.gplus @ 2019-03-29 16:10 UTC (permalink / raw)


Hello,
I'm looking for a way to define a type that runs from let say -100 to +100 with gaps of 5 width. Important is to make sure that a value like 7 can not be assigned to the type.

something like:

type number is new integer range -100 .. 100;
-- or
subtype number is integer range -100 .. 100;

-- with this special thing or something like that:
for number'small use 5; -- can not applied here. works with fixed point types only

Thanks !


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-04-01 16:41 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-29 16:10 type definition for an integer with discrete range mario.blunk.gplus
2019-03-29 16:34 ` tranngocduong
2019-03-29 16:46   ` mario.blunk.gplus
2019-03-30  4:17     ` tranngocduong
2019-03-30  4:19       ` tranngocduong
2019-03-29 20:24   ` Simon Wright
2019-03-29 20:51     ` mario.blunk.gplus
2019-03-29 21:24       ` Simon Wright
2019-03-30 20:44         ` mario.blunk.gplus
2019-03-30 22:13           ` Jere
2019-04-01  6:59             ` mario.blunk.gplus
2019-04-01 15:52               ` AdaMagica
2019-04-01 16:27                 ` Simon Wright
2019-04-01 16:41                   ` AdaMagica
2019-03-29 21:57       ` Dmitry A. Kazakov
2019-03-30 21:45 ` John Perry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox