float.mod
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· MOD 代码 · 共 43 行
MOD
43 行
(*#@(#)float.mod 4.1 Ultrix 7/17/90 *)module testfloat;from io import writef, output;var i : integer; c : cardinal; r : real; l : longreal;begin i := -12345678; c := 12345678; r := float(i); if r <> -12345678.0 then writef(output,"i->r\n"); end; r := float(c); if r <> 12345678.0 then writef(output,"c->r\n"); end; l := longfloat(i); if l <> -12345678.0 then writef(output,"i->l\n"); end; l := longfloat(c); if l <> 12345678.0 then writef(output,"c->l\n"); end; r := 12345678.0; l := 12345678.9; i := trunc(r); if i <> 12345678 then writef(output,"r->i\n"); end; c := trunc(r); if c <> 12345678 then writef(output,"r->c\n"); end; i := trunc(l); if i <> 12345678 then writef(output,"l->i\n"); end; c := trunc(l); if c <> 12345678 then writef(output,"l->c\n"); end;end testfloat.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?