Ada 编程/关键字/delta
外观
这个关键字用于声明 定点类型。Delta 代表 定点类型的绝对误差界限;也就是说,delta 为编译器提供一个提示,告诉它如何选择该类型最小增量值,称为该类型的Small。该 Small 值可以通过属性 T'Small 访问。
对于普通定点类型,它默认情况下为不大于 delta 的 2 的幂;它可以通过属性子句指定为不大于 delta 的任何值。
对于十进制定点类型,Small 值等于 delta,当然 delta 必须是 10 的幂。
type
Fixed_Pointis
delta
0.01digits
10; -- A decimal fixed point type My_Fixed_Point : Fixed_Point := 0.0; ... My_Fixed_Point := 0.1; -- Ok My_Fixed_Point := 0.02; -- Ok My_Fixed_Point := 0.001; -- Oops - this value is too small. -- It will be represented by zero.
- 2.9 保留字 (带注释的)
- 附录 P(信息性)语法摘要 (带注释的)
Ada 关键字 | ||||
---|---|---|---|---|
abort
|
else
|
new
|
return
|
|
abs
|
elsif
|
not
|
reverse
|
|
abstract (Ada 95) |
end
|
null
|
||
accept
|
entry
|
select
|
||
access
|
exception
|
of
|
separate
|
|
aliased (Ada 95) |
exit
|
or
|
some (Ada 2012) |
|
all
|
others
|
subtype
|
||
and
|
for
|
out
|
synchronized (Ada 2005) |
|
array
|
function
|
overriding (Ada 2005) |
||
at
|
tagged (Ada 95) |
|||
generic
|
package
|
task
|
||
begin
|
goto
|
parallel (Ada 2022) |
terminate
|
|
body
|
pragma
|
then
|
||
if
|
private
|
type
|
||
case
|
in
|
procedure
|
||
constant
|
interface (Ada 2005) |
protected (Ada 95) |
until (Ada 95) |
|
is
|
use
|
|||
declare
|
raise
|
|||
delay
|
limited
|
range
|
when
|
|
delta
|
loop
|
record
|
while
|
|
digits
|
rem
|
with
|
||
do
|
mod
|
renames
|
||
requeue (Ada 95) |
xor
|