Skip to content

Commit

Permalink
Oldest version known to work = Go 1.8, closes google#177
Browse files Browse the repository at this point in the history
It seems like it was broken on older compilers
since pregenerated stdlib AST.

It adds go 1.8.x to travis, so that we have a chance
of catching when our "known to work" no longer holds.
  • Loading branch information
sbarzowski authored and sparkprime committed Jan 18, 2018
1 parent d135eff commit d6623a9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ language: go
sudo: false
go:
- 1.x
- 1.8.x
- tip
before_install:
- go get github.com/axw/gocov/gocov
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ feature complete but is not as heavily exercised as the [Jsonnet C++
implementation](https://github.com/google/jsonnet). Please try it out and give
feedback.

This code is known to work on Go 1.6 and above.
This code is known to work on Go 1.8 and above. We recommend always using the newest stable release of Go.

## Build instructions

Expand Down
9 changes: 8 additions & 1 deletion builtins.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,14 @@ var builtinAsin = liftNumeric(math.Asin)
var builtinAcos = liftNumeric(math.Acos)
var builtinAtan = liftNumeric(math.Atan)
var builtinLog = liftNumeric(math.Log)
var builtinExp = liftNumeric(math.Exp)
var builtinExp = liftNumeric(func(f float64) float64 {
res := math.Exp(f)
if res == 0 && f > 0 {
return math.Inf(1)
} else {
return res
}
})
var builtinMantissa = liftNumeric(func(f float64) float64 {
mantissa, _ := math.Frexp(f)
return mantissa
Expand Down

0 comments on commit d6623a9

Please sign in to comment.