Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Infinity/Go/infinity.go
Normal file
19
Task/Infinity/Go/infinity.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
)
|
||||
|
||||
// function called for by task
|
||||
func posInf() float64 {
|
||||
return math.Inf(1) // argument specifies positive infinity
|
||||
}
|
||||
|
||||
func main() {
|
||||
x := 1.5 // type of x determined by literal
|
||||
// that this compiles demonstrates that PosInf returns same type as x,
|
||||
// the type specified by the task.
|
||||
x = posInf() // test function
|
||||
fmt.Println(x, math.IsInf(x, 1)) // demonstrate result
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue