Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
9
Task/Literals-Integer/Ada/literals-integer.adb
Normal file
9
Task/Literals-Integer/Ada/literals-integer.adb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
|
||||
|
||||
procedure Test_Literals is
|
||||
begin
|
||||
Put (16#2D7#);
|
||||
Put (10#727#);
|
||||
Put (8#1_327#);
|
||||
Put (2#10_1101_0111#);
|
||||
end Test_Literals;
|
||||
2
Task/Literals-Integer/COBOL/literals-integer-1.cob
Normal file
2
Task/Literals-Integer/COBOL/literals-integer-1.cob
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
display B#10 ", " O#01234567 ", " -0123456789 ", "
|
||||
H#0123456789ABCDEF ", " X#0123456789ABCDEF ", " 1;2;3;4
|
||||
2
Task/Literals-Integer/COBOL/literals-integer-2.cob
Normal file
2
Task/Literals-Integer/COBOL/literals-integer-2.cob
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
if 1234 = 1,2,3,4 then display "Decimal point is not comma" end-if
|
||||
if 1234 = 1;2;3;4 then display "literals are equal, semi-colons ignored" end-if
|
||||
|
|
@ -1,16 +1,16 @@
|
|||
^|
|
||||
| EMal internally uses 64 bit signed integers.
|
||||
|^
|
||||
int hex = 0xff # base16
|
||||
int oct = 0o377 # base8
|
||||
int bin = 0b11111111 # base2
|
||||
int dec = 255 # base10
|
||||
int hex ← 0xff # base16
|
||||
int oct ← 0o377 # base8
|
||||
int bin ← 0b11111111 # base2
|
||||
int dec ← 255 # base10
|
||||
writeLine(hex)
|
||||
writeLine(oct)
|
||||
writeLine(bin)
|
||||
writeLine(dec)
|
||||
# here we check that they give the same value
|
||||
writeLine(0b1011010111 == 0o1327 and
|
||||
0o1327 == 0x2d7 and
|
||||
0x2d7 == 727 and
|
||||
727 == 0b1011010111)
|
||||
writeLine(0b1011010111 æ 0o1327 and
|
||||
0o1327 æ 0x2d7 and
|
||||
0x2d7 æ 727 and
|
||||
727 æ 0b1011010111)
|
||||
|
|
|
|||
5
Task/Literals-Integer/Emacs-Lisp/literals-integer.el
Normal file
5
Task/Literals-Integer/Emacs-Lisp/literals-integer.el
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
123 ;; decimal all Emacs
|
||||
#b101 ;; binary Emacs 21 up, XEmacs 21
|
||||
#o77 ;; octal Emacs 21 up, XEmacs 21
|
||||
#xFF ;; hex Emacs 21 up, XEmacs 21
|
||||
#3r210 ;; any radix 2-36 Emacs 21 up (but not XEmacs 21.4)
|
||||
6
Task/Literals-Integer/Euphoria/literals-integer.eu
Normal file
6
Task/Literals-Integer/Euphoria/literals-integer.eu
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
printf(1,"Decimal:\t%d, %d, %d, %d\n",{-10,10,16,64})
|
||||
printf(1,"Hex:\t%x, %x, %x, %x\n",{-10,10,16,64})
|
||||
printf(1,"Octal:\t%o, %o, %o, %o\n",{-10,10,16,64})
|
||||
printf(1,"Exponential:\t%e, %e, %e, %e\n",{-10,10,16,64.12})
|
||||
printf(1,"Floating Point\t%3.3f, %3.3f, %+3.3f\n",{-10,10.2,16.25,64.12625})
|
||||
printf(1,"Floating Point or Exponential: %g, %g, %g, %g\n",{10,16,64,123456789.123})
|
||||
2
Task/Literals-Integer/PowerShell/literals-integer-1.ps1
Normal file
2
Task/Literals-Integer/PowerShell/literals-integer-1.ps1
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
727 # base 10
|
||||
0x2d7 # base 16
|
||||
4
Task/Literals-Integer/PowerShell/literals-integer-2.ps1
Normal file
4
Task/Literals-Integer/PowerShell/literals-integer-2.ps1
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
3KB # 3072
|
||||
3MB # 3145728
|
||||
3GB # 3221225472
|
||||
3TB # 3298534883328
|
||||
2
Task/Literals-Integer/Rebol/literals-integer-1.rebol
Normal file
2
Task/Literals-Integer/Rebol/literals-integer-1.rebol
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
1
|
||||
1'000
|
||||
8
Task/Literals-Integer/Rebol/literals-integer-2.rebol
Normal file
8
Task/Literals-Integer/Rebol/literals-integer-2.rebol
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
2#11
|
||||
;== 3
|
||||
8#644
|
||||
;== 420
|
||||
0#FF
|
||||
;== 255
|
||||
16#FF
|
||||
;== 255
|
||||
Loading…
Add table
Add a link
Reference in a new issue