-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
68655ed
commit eb17e08
Showing
2 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,32 @@ | ||
package internal | ||
|
||
func Summ(a, b int) int { | ||
import ( | ||
"math" | ||
) | ||
|
||
func Soch(a, b int) int { | ||
return a + b | ||
} | ||
|
||
func Equation(x float64) float64 { | ||
a := 0.4 | ||
b := 0.8 | ||
return (math.Pow(a, x) - math.Pow(b, x)) / (math.Log10(a/b) * math.Pow(a*b, 1/3.0)) | ||
} | ||
|
||
func CalcA(x_begin, x_end, x_delta float64) []float64 { | ||
var num_of_elements int = int((x_end) - (x_begin)/x_delta + 1) | ||
var ResultA = make([]float64, 0, num_of_elements) | ||
for i := x_begin; i <= x_end; i = i + x_delta { | ||
ResultA = append(ResultA, Equation(i)) | ||
} | ||
return ResultA | ||
} | ||
|
||
func CalcB(slice []float64) []float64 { | ||
var ResultB = make([]float64, 0, len(slice)) | ||
for _, i := range slice { | ||
ResultB = append(ResultB, Equation(i)) | ||
} | ||
return ResultB | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
package main | ||
|
||
import "fmt" | ||
import ( | ||
"fmt" | ||
|
||
"isuct.ru/informatics2022/internal" | ||
) | ||
|
||
func main() { | ||
fmt.Println("Hello world") | ||
fmt.Println("Колядина Алина Олеговна") | ||
fmt.Println("Вариант 7") | ||
fmt.Println(internal.CalcA(3.2, 6.2, 0.6)) | ||
fmt.Println(internal.CalcB([]float64{4.48, 3.56, 2.78, 5.28, 3.21})) | ||
} |