Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
|
|
@ -0,0 +1,32 @@
|
|||
' FB 1.05.0
|
||||
|
||||
' Note that 'base' is a keyword in FB, so we use 'base_' instead as a parameter
|
||||
|
||||
Function Pow Overload (base_ As Double, exponent As Integer) As Double
|
||||
If exponent = 0.0 Then Return 1.0
|
||||
If exponent = 1.0 Then Return base_
|
||||
If exponent < 0.0 Then Return 1.0 / Pow(base_, -exponent)
|
||||
Dim power As Double = base_
|
||||
For i As Integer = 2 To exponent
|
||||
power *= base_
|
||||
Next
|
||||
Return power
|
||||
End Function
|
||||
|
||||
Function Pow Overload(base_ As Integer, exponent As Integer) As Double
|
||||
Return Pow(CDbl(base_), exponent)
|
||||
End Function
|
||||
|
||||
' check results of these functions using FB's built in '^' operator
|
||||
Print "Pow(2, 2) = "; Pow(2, 2)
|
||||
Print "Pow(2.5, 2) = "; Pow(2.5, 2)
|
||||
Print "Pow(2, -3) = "; Pow(2, -3)
|
||||
Print "Pow(1.78, 3) = "; Pow(1.78, 3)
|
||||
Print
|
||||
Print "2 ^ 2 = "; 2 ^ 2
|
||||
Print "2.5 ^ 2 = "; 2.5 ^ 2
|
||||
Print "2 ^ -3 = "; 2 ^ -3
|
||||
Print "1.78 ^ 3 = "; 1.78 ^ 3
|
||||
Print
|
||||
Print "Press any key to quit"
|
||||
Sleep
|
||||
Loading…
Add table
Add a link
Reference in a new issue