Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
1
Task/Function-definition/Ada/function-definition-1.adb
Normal file
1
Task/Function-definition/Ada/function-definition-1.adb
Normal file
|
|
@ -0,0 +1 @@
|
|||
function Multiply (A, B : Float) return Float;
|
||||
4
Task/Function-definition/Ada/function-definition-2.adb
Normal file
4
Task/Function-definition/Ada/function-definition-2.adb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
function Multiply (A, B : Float) return Float is
|
||||
begin
|
||||
return A * B;
|
||||
end Multiply;
|
||||
1
Task/Function-definition/Ada/function-definition-3.adb
Normal file
1
Task/Function-definition/Ada/function-definition-3.adb
Normal file
|
|
@ -0,0 +1 @@
|
|||
function Multiply(A, B: Float) return Float is (A * B);
|
||||
3
Task/Function-definition/Ada/function-definition-4.adb
Normal file
3
Task/Function-definition/Ada/function-definition-4.adb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
generic
|
||||
type Number is digits <>;
|
||||
function Multiply (A, B : Number) return Number;
|
||||
4
Task/Function-definition/Ada/function-definition-5.adb
Normal file
4
Task/Function-definition/Ada/function-definition-5.adb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
function Multiply (A, B : Number) return Number is
|
||||
begin
|
||||
return A * B;
|
||||
end Multiply;
|
||||
7
Task/Function-definition/Ada/function-definition-6.adb
Normal file
7
Task/Function-definition/Ada/function-definition-6.adb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
with Multiply;
|
||||
...
|
||||
function Multiply_Integer is new Multiply(Number => Integer);
|
||||
use Multiply_Integer; -- If you must
|
||||
|
||||
type My_Integer is Range -100..100;
|
||||
function Multiply_My_Integer is new Multiply(My_Integer);
|
||||
7
Task/Function-definition/AutoIt/function-definition.au3
Normal file
7
Task/Function-definition/AutoIt/function-definition.au3
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#AutoIt Version: 3.2.10.0
|
||||
$I=11
|
||||
$J=12
|
||||
MsgBox(0,"Multiply", $I &" * "& $J &" = " & product($I,$J))
|
||||
Func product($a,$b)
|
||||
Return $a * $b
|
||||
EndFunc
|
||||
26
Task/Function-definition/COBOL/function-definition-1.cob
Normal file
26
Task/Function-definition/COBOL/function-definition-1.cob
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
IDENTIFICATION DIVISION.
|
||||
PROGRAM-ID. myTest.
|
||||
DATA DIVISION.
|
||||
WORKING-STORAGE SECTION.
|
||||
01 x PICTURE IS 9(3) VALUE IS 3.
|
||||
01 y PICTURE IS 9(3) VALUE IS 2.
|
||||
01 z PICTURE IS 9(9).
|
||||
PROCEDURE DIVISION.
|
||||
CALL "myMultiply" USING
|
||||
BY CONTENT x, BY CONTENT y,
|
||||
BY REFERENCE z.
|
||||
DISPLAY z.
|
||||
STOP RUN.
|
||||
END PROGRAM myTest.
|
||||
|
||||
IDENTIFICATION DIVISION.
|
||||
PROGRAM-ID. myMultiply.
|
||||
DATA DIVISION.
|
||||
LINKAGE SECTION.
|
||||
01 x PICTURE IS 9(3).
|
||||
01 y PICTURE IS 9(3).
|
||||
01 z PICTURE IS 9(9).
|
||||
PROCEDURE DIVISION USING BY REFERENCE x, y, z.
|
||||
MULTIPLY x BY y GIVING z.
|
||||
EXIT PROGRAM.
|
||||
END PROGRAM myMultiply.
|
||||
26
Task/Function-definition/COBOL/function-definition-2.cob
Normal file
26
Task/Function-definition/COBOL/function-definition-2.cob
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
IDENTIFICATION DIVISION.
|
||||
PROGRAM-ID. myTest.
|
||||
ENVIRONMENT DIVISION.
|
||||
CONFIGURATION SECTION.
|
||||
REPOSITORY.
|
||||
FUNCTION myMultiply.
|
||||
DATA DIVISION.
|
||||
WORKING-STORAGE SECTION.
|
||||
01 x PICTURE IS 9(3) VALUE IS 3.
|
||||
01 y PICTURE IS 9(3) VALUE IS 2.
|
||||
PROCEDURE DIVISION.
|
||||
DISPLAY myMultiply(x, y).
|
||||
STOP RUN.
|
||||
END PROGRAM myTest.
|
||||
|
||||
IDENTIFICATION DIVISION.
|
||||
FUNCTION-ID. myMultiply.
|
||||
DATA DIVISION.
|
||||
LINKAGE SECTION.
|
||||
01 x PICTURE IS 9(3).
|
||||
01 y PICTURE IS 9(3).
|
||||
01 z PICTURE IS 9(9).
|
||||
PROCEDURE DIVISION USING x, y RETURNING z.
|
||||
MULTIPLY x BY y GIVING z.
|
||||
GOBACK.
|
||||
END FUNCTION myMultiply.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
proc multiply(a, b)
|
||||
{
|
||||
return a * b;
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
proc multiply(a : ?t ... 2)
|
||||
{
|
||||
return a(0) * a(1)
|
||||
}
|
||||
16
Task/Function-definition/Crystal/function-definition.cr
Normal file
16
Task/Function-definition/Crystal/function-definition.cr
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
def multiply (a, b)
|
||||
a * b
|
||||
end
|
||||
|
||||
# with type restrictions:
|
||||
def multiply (a : Int32, b : Int32)
|
||||
print "(typed overload) "
|
||||
a * b
|
||||
end
|
||||
|
||||
# proc (anonymous function)
|
||||
m = ->(a : Int32, b : Int32) { a * b }
|
||||
|
||||
p! multiply(2, 3),
|
||||
multiply(2.0, 3.0),
|
||||
m.call(2, 3)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
(defun multiply (x y)
|
||||
(* x y))
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
(defun multiply (x y)
|
||||
"Return the product of X and Y."
|
||||
(* x y))
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
function multiply( atom a, atom b )
|
||||
return a * b
|
||||
end function
|
||||
12
Task/Function-definition/Euphoria/function-definition-2.eu
Normal file
12
Task/Function-definition/Euphoria/function-definition-2.eu
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
function multiply( object a, object b )
|
||||
return a * b
|
||||
end function
|
||||
|
||||
sequence a = {1,2,3,4}
|
||||
sequence b = {5,6,7,8}
|
||||
|
||||
? multiply( 9, 9 )
|
||||
? multiply( 3.14159, 3.14159 )
|
||||
? multiply( a, b )
|
||||
? multiply( a, 7 )
|
||||
? multiply( 10.39564, b )
|
||||
3
Task/Function-definition/Gleam/function-definition.gleam
Normal file
3
Task/Function-definition/Gleam/function-definition.gleam
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fn multiply(x: Int, y: Int) -> Int {
|
||||
x * y
|
||||
}
|
||||
3
Task/Function-definition/Haxe/function-definition.hx
Normal file
3
Task/Function-definition/Haxe/function-definition.hx
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
function multiply(x:Float, y:Float):Float{
|
||||
return x * y;
|
||||
}
|
||||
9
Task/Function-definition/LOLCODE/function-definition.lol
Normal file
9
Task/Function-definition/LOLCODE/function-definition.lol
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
HAI 1.3
|
||||
|
||||
HOW IZ I MULTIPLY YR X AN YR Y
|
||||
FOUND YR PRODUKT OF X AN Y
|
||||
IF U SAY SO
|
||||
|
||||
VISIBLE I IZ MULTIPLY YR 2 AND YR 3 MKAY
|
||||
|
||||
KTHXBYE
|
||||
|
|
@ -1 +1 @@
|
|||
val multiply = fn{*}
|
||||
val multiply = fn(a, b) { a * b }
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
val multiply = fn a, b: a * b
|
||||
val multiply = fn{*}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
val multiply = fn(a, b) { a * b }
|
||||
val timestwo = fn{*2}
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
val factorial = fn(x) { if(x < 2: 1; x * fn((x - 1))) }
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
function multiply {
|
||||
return $args[0] * $args[1]
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
function multiply {
|
||||
$args[0] * $args[1]
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
function multiply ($a, $b) {
|
||||
return $a * $b
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
function multiply {
|
||||
param ($a, $b)
|
||||
return $a * $b
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
function multiply ([int] $a, [int] $b) {
|
||||
return $a * $b
|
||||
}
|
||||
34
Task/Function-definition/REXX/function-definition.rexx
Normal file
34
Task/Function-definition/REXX/function-definition.rexx
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
-- 11 Sep 2025
|
||||
include Setting
|
||||
|
||||
say 'FUNCTION DEFINITION'
|
||||
say version
|
||||
say
|
||||
xx=0; yy=0; rr=0
|
||||
say 'xx =' xx 'yy =' yy 'rr =' rr
|
||||
say 'Multiply1(2,3)' '=' Multiply1(2,3)
|
||||
say 'xx =' xx 'yy =' yy 'rr =' rr
|
||||
say 'Multiply2(3,5)' '=' Multiply2(3,5)
|
||||
say 'xx =' xx 'yy =' yy 'rr =' rr
|
||||
xx=5; yy=7
|
||||
say 'xx =' xx 'yy =' yy 'rr =' rr
|
||||
say 'Multiply3(5,7)' '=' Multiply3()
|
||||
say 'xx =' xx 'yy =' yy 'rr =' rr
|
||||
exit
|
||||
|
||||
Multiply1:
|
||||
procedure
|
||||
arg xx,yy
|
||||
rr=xx*yy
|
||||
return rr
|
||||
|
||||
Multiply2:
|
||||
arg xx,yy
|
||||
rr=xx*yy
|
||||
return rr
|
||||
|
||||
Multiply3:
|
||||
rr=xx*yy
|
||||
return rr
|
||||
|
||||
include Math
|
||||
1
Task/Function-definition/Rebol/function-definition.rebol
Normal file
1
Task/Function-definition/Rebol/function-definition.rebol
Normal file
|
|
@ -0,0 +1 @@
|
|||
multiply: func [a b][a * b]
|
||||
1
Task/Function-definition/Rye/function-definition-1.rye
Normal file
1
Task/Function-definition/Rye/function-definition-1.rye
Normal file
|
|
@ -0,0 +1 @@
|
|||
multiply: fn { a b } { a * b }
|
||||
1
Task/Function-definition/Rye/function-definition-2.rye
Normal file
1
Task/Function-definition/Rye/function-definition-2.rye
Normal file
|
|
@ -0,0 +1 @@
|
|||
multiply: fn { a b } { * b }
|
||||
1
Task/Function-definition/Rye/function-definition-3.rye
Normal file
1
Task/Function-definition/Rye/function-definition-3.rye
Normal file
|
|
@ -0,0 +1 @@
|
|||
multiply: pfn { a b } { a * b }
|
||||
3
Task/Function-definition/SIL/function-definition.sil
Normal file
3
Task/Function-definition/SIL/function-definition.sil
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
funcmultiply
|
||||
r = x * y
|
||||
return
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
function multiply( multiplicand, multiplier )
|
||||
multiply = multiplicand * multiplier
|
||||
end function
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
dim twosquared
|
||||
twosquared = multiply(2, 2)
|
||||
Loading…
Add table
Add a link
Reference in a new issue