First commit of partial RosettaCode contents.
Pushing this for testing purposes. Lots of work still needed.
This commit is contained in:
commit
1e05ecd7ee
781 changed files with 9080 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