<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/go-git.git/src/math/big/ratconv.go, branch dev.debug</title>
<subtitle>github.com: golang/go
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/'/>
<entry>
<title>math/big: implement Float.Scan, type assert fmt interfaces to enforce docs</title>
<updated>2016-10-19T03:25:30+00:00</updated>
<author>
<name>Emmanuel Odeke</name>
<email>emm.odeke@gmail.com</email>
</author>
<published>2016-10-10T05:45:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=f36e1adaa2c72d74dc669b596ea1c4df5e938def'/>
<id>f36e1adaa2c72d74dc669b596ea1c4df5e938def</id>
<content type='text'>
Implements Float.Scan which satisfies fmt.Scanner interface.
Also enforces docs' interface implementation claims with compile time
type assertions, that is:
+ Float always implements fmt.Formatter and fmt.Scanner
+ Int always implements fmt.Formatter and fmt.Scanner
+ Rat always implements fmt.Formatter
which will ensure that the API claims are strictly matched.

Also note that Float.Scan doesn't handle ±Inf.

Fixes #17391

Change-Id: I3d3dfbe7f602066975c7a7794fe25b4c645440ce
Reviewed-on: https://go-review.googlesource.com/30723
Reviewed-by: Robert Griesemer &lt;gri@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implements Float.Scan which satisfies fmt.Scanner interface.
Also enforces docs' interface implementation claims with compile time
type assertions, that is:
+ Float always implements fmt.Formatter and fmt.Scanner
+ Int always implements fmt.Formatter and fmt.Scanner
+ Rat always implements fmt.Formatter
which will ensure that the API claims are strictly matched.

Also note that Float.Scan doesn't handle ±Inf.

Fixes #17391

Change-Id: I3d3dfbe7f602066975c7a7794fe25b4c645440ce
Reviewed-on: https://go-review.googlesource.com/30723
Reviewed-by: Robert Griesemer &lt;gri@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>math/big: Rat.SetString to report error if input is not consumed entirely</title>
<updated>2016-10-06T20:37:01+00:00</updated>
<author>
<name>Robert Griesemer</name>
<email>gri@golang.org</email>
</author>
<published>2016-10-05T22:01:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=95a6572b2b84e8cbfd821c4e5f774f20d37c007e'/>
<id>95a6572b2b84e8cbfd821c4e5f774f20d37c007e</id>
<content type='text'>
Also, document behavior explicitly for all SetString implementations.

Fixes #17001.

Change-Id: Iccc882b4bc7f8b61b6092f330e405c146a80dc98
Reviewed-on: https://go-review.googlesource.com/30472
Reviewed-by: Matthew Dempsky &lt;mdempsky@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also, document behavior explicitly for all SetString implementations.

Fixes #17001.

Change-Id: Iccc882b4bc7f8b61b6092f330e405c146a80dc98
Reviewed-on: https://go-review.googlesource.com/30472
Reviewed-by: Matthew Dempsky &lt;mdempsky@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>math/big: special-case a 0 mantissa during Rat parsing</title>
<updated>2016-06-24T20:51:06+00:00</updated>
<author>
<name>Nathan VanBenschoten</name>
<email>nvanbenschoten@gmail.com</email>
</author>
<published>2016-06-23T23:46:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=5e43dc943a9265ec65690242eb8076727c18a958'/>
<id>5e43dc943a9265ec65690242eb8076727c18a958</id>
<content type='text'>
Previously, a 0 mantissa was special-cased during big.Float
parsing, but not during big.Rat parsing. This meant that a value
like 0e9999999999 would parse successfully in big.Float.SetString,
but would hang in big.Rat.SetString. This discrepancy became an
issue in https://golang.org/src/go/constant/value.go?#L250,
where the big.Float would report an exponent of 0, so
big.Rat.SetString would be used and would subsequently hang.

A Go Playground example of this is https://play.golang.org/p/3fy28eUJuF

The solution is to special-case a zero mantissa during big.Rat
parsing as well, so that neither big.Rat nor big.Float will hang when
parsing a value with 0 mantissa but a large exponent.

This was discovered using go-fuzz on CockroachDB:
https://github.com/cockroachdb/go-fuzz/blob/master/examples/parser/main.go

Fixes #16176

Change-Id: I775558a8682adbeba1cc9d20ba10f8ed26259c56
Reviewed-on: https://go-review.googlesource.com/24430
Reviewed-by: Robert Griesemer &lt;gri@golang.org&gt;
Run-TryBot: Robert Griesemer &lt;gri@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, a 0 mantissa was special-cased during big.Float
parsing, but not during big.Rat parsing. This meant that a value
like 0e9999999999 would parse successfully in big.Float.SetString,
but would hang in big.Rat.SetString. This discrepancy became an
issue in https://golang.org/src/go/constant/value.go?#L250,
where the big.Float would report an exponent of 0, so
big.Rat.SetString would be used and would subsequently hang.

A Go Playground example of this is https://play.golang.org/p/3fy28eUJuF

The solution is to special-case a zero mantissa during big.Rat
parsing as well, so that neither big.Rat nor big.Float will hang when
parsing a value with 0 mantissa but a large exponent.

This was discovered using go-fuzz on CockroachDB:
https://github.com/cockroachdb/go-fuzz/blob/master/examples/parser/main.go

Fixes #16176

Change-Id: I775558a8682adbeba1cc9d20ba10f8ed26259c56
Reviewed-on: https://go-review.googlesource.com/24430
Reviewed-by: Robert Griesemer &lt;gri@golang.org&gt;
Run-TryBot: Robert Griesemer &lt;gri@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>all: remove unnecessary type conversions</title>
<updated>2016-04-15T07:31:45+00:00</updated>
<author>
<name>Matthew Dempsky</name>
<email>mdempsky@google.com</email>
</author>
<published>2016-04-15T02:09:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=0da4dbe2322eb3b6224df35ce3e9fc83f104762b'/>
<id>0da4dbe2322eb3b6224df35ce3e9fc83f104762b</id>
<content type='text'>
cmd and runtime were handled separately, and I'm intentionally skipped
syscall. This is the rest of the standard library.

CL generated mechanically with github.com/mdempsky/unconvert.

Change-Id: I9e0eff886974dedc37adb93f602064b83e469122
Reviewed-on: https://go-review.googlesource.com/22104
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Run-TryBot: Matthew Dempsky &lt;mdempsky@google.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
cmd and runtime were handled separately, and I'm intentionally skipped
syscall. This is the rest of the standard library.

CL generated mechanically with github.com/mdempsky/unconvert.

Change-Id: I9e0eff886974dedc37adb93f602064b83e469122
Reviewed-on: https://go-review.googlesource.com/22104
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Run-TryBot: Matthew Dempsky &lt;mdempsky@google.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>all: replace strings.Index with strings.Contains where possible</title>
<updated>2016-02-19T01:06:05+00:00</updated>
<author>
<name>Nathan VanBenschoten</name>
<email>nvanbenschoten@gmail.com</email>
</author>
<published>2015-12-22T07:40:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=b04f3b06ec347543b0eafe82dcfb0e05885d3feb'/>
<id>b04f3b06ec347543b0eafe82dcfb0e05885d3feb</id>
<content type='text'>
Change-Id: Ia613f1c37bfce800ece0533a5326fca91d99a66a
Reviewed-on: https://go-review.googlesource.com/18120
Reviewed-by: Robert Griesemer &lt;gri@golang.org&gt;
Run-TryBot: Robert Griesemer &lt;gri@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: Ia613f1c37bfce800ece0533a5326fca91d99a66a
Reviewed-on: https://go-review.googlesource.com/18120
Reviewed-by: Robert Griesemer &lt;gri@golang.org&gt;
Run-TryBot: Robert Griesemer &lt;gri@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>math/big: removed more unnecessary string conversions</title>
<updated>2015-09-25T22:25:12+00:00</updated>
<author>
<name>Robert Griesemer</name>
<email>gri@golang.org</email>
</author>
<published>2015-09-25T17:09:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=e937eeeccdbf07df30ad4ea8ebd3cc20742b3200'/>
<id>e937eeeccdbf07df30ad4ea8ebd3cc20742b3200</id>
<content type='text'>
- renamed (nat) itoa to utoa (since that's what it is)
- added (nat) itoa that takes a sign parameter; this helps removing a few string copies
- used buffers instead of string+ in Rat conversions

Change-Id: I6b37a6b39557ae311cafdfe5c4a26e9246bde1a9
Reviewed-on: https://go-review.googlesource.com/14995
Reviewed-by: Alan Donovan &lt;adonovan@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- renamed (nat) itoa to utoa (since that's what it is)
- added (nat) itoa that takes a sign parameter; this helps removing a few string copies
- used buffers instead of string+ in Rat conversions

Change-Id: I6b37a6b39557ae311cafdfe5c4a26e9246bde1a9
Reviewed-on: https://go-review.googlesource.com/14995
Reviewed-by: Alan Donovan &lt;adonovan@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>math/big: faster string conversion routines</title>
<updated>2015-09-24T23:07:47+00:00</updated>
<author>
<name>Robert Griesemer</name>
<email>gri@golang.org</email>
</author>
<published>2015-09-24T22:10:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=b07a9efa7841ccd14a694d026a1e62111989f9d1'/>
<id>b07a9efa7841ccd14a694d026a1e62111989f9d1</id>
<content type='text'>
Eliminated unnecessary string conversions throughout and removed
(internal) capability for arbitrary character sets in conversion
routines (functionality was not exported and not used internally).

benchmark                         old ns/op     new ns/op     delta
BenchmarkDecimalConversion-8      198283        187085        -5.65%
BenchmarkStringPiParallel-8       46116         47822         +3.70%
BenchmarkString10Base2-8          216           166           -23.15%
BenchmarkString100Base2-8         886           762           -14.00%
BenchmarkString1000Base2-8        7296          6625          -9.20%
BenchmarkString10000Base2-8       72371         65563         -9.41%
BenchmarkString100000Base2-8      725849        672766        -7.31%
BenchmarkString10Base8-8          160           114           -28.75%
BenchmarkString100Base8-8         398           309           -22.36%
BenchmarkString1000Base8-8        2650          2244          -15.32%
BenchmarkString10000Base8-8       24974         21745         -12.93%
BenchmarkString100000Base8-8      245457        217489        -11.39%
BenchmarkString10Base10-8         337           288           -14.54%
BenchmarkString100Base10-8        1298          1046          -19.41%
BenchmarkString1000Base10-8       6200          5752          -7.23%
BenchmarkString10000Base10-8      24942         22589         -9.43%
BenchmarkString100000Base10-8     8012921       7947152       -0.82%
BenchmarkString10Base16-8         156           107           -31.41%
BenchmarkString100Base16-8        344           255           -25.87%
BenchmarkString1000Base16-8       2067          1705          -17.51%
BenchmarkString10000Base16-8      19026         16112         -15.32%
BenchmarkString100000Base16-8     184038        163457        -11.18%

Change-Id: I68bd807529bd9b985f4b6ac2a87764bcc1a7d2f7
Reviewed-on: https://go-review.googlesource.com/14926
Reviewed-by: Alan Donovan &lt;adonovan@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Eliminated unnecessary string conversions throughout and removed
(internal) capability for arbitrary character sets in conversion
routines (functionality was not exported and not used internally).

benchmark                         old ns/op     new ns/op     delta
BenchmarkDecimalConversion-8      198283        187085        -5.65%
BenchmarkStringPiParallel-8       46116         47822         +3.70%
BenchmarkString10Base2-8          216           166           -23.15%
BenchmarkString100Base2-8         886           762           -14.00%
BenchmarkString1000Base2-8        7296          6625          -9.20%
BenchmarkString10000Base2-8       72371         65563         -9.41%
BenchmarkString100000Base2-8      725849        672766        -7.31%
BenchmarkString10Base8-8          160           114           -28.75%
BenchmarkString100Base8-8         398           309           -22.36%
BenchmarkString1000Base8-8        2650          2244          -15.32%
BenchmarkString10000Base8-8       24974         21745         -12.93%
BenchmarkString100000Base8-8      245457        217489        -11.39%
BenchmarkString10Base10-8         337           288           -14.54%
BenchmarkString100Base10-8        1298          1046          -19.41%
BenchmarkString1000Base10-8       6200          5752          -7.23%
BenchmarkString10000Base10-8      24942         22589         -9.43%
BenchmarkString100000Base10-8     8012921       7947152       -0.82%
BenchmarkString10Base16-8         156           107           -31.41%
BenchmarkString100Base16-8        344           255           -25.87%
BenchmarkString1000Base16-8       2067          1705          -17.51%
BenchmarkString10000Base16-8      19026         16112         -15.32%
BenchmarkString100000Base16-8     184038        163457        -11.18%

Change-Id: I68bd807529bd9b985f4b6ac2a87764bcc1a7d2f7
Reviewed-on: https://go-review.googlesource.com/14926
Reviewed-by: Alan Donovan &lt;adonovan@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>math/big: document rounding for Rat.FloatToString</title>
<updated>2015-07-22T19:47:19+00:00</updated>
<author>
<name>Robert Griesemer</name>
<email>gri@golang.org</email>
</author>
<published>2015-07-22T19:33:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=f35bc3ee87e1771891e2087363381bda616e67ee'/>
<id>f35bc3ee87e1771891e2087363381bda616e67ee</id>
<content type='text'>
Fixes #11523.

Change-Id: I172f6facd555a1c6db76f25d5097343c20dea59a
Reviewed-on: https://go-review.googlesource.com/12507
Reviewed-by: Alan Donovan &lt;adonovan@google.com&gt;
Reviewed-by: Russ Cox &lt;rsc@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #11523.

Change-Id: I172f6facd555a1c6db76f25d5097343c20dea59a
Reviewed-on: https://go-review.googlesource.com/12507
Reviewed-by: Alan Donovan &lt;adonovan@google.com&gt;
Reviewed-by: Russ Cox &lt;rsc@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>math/big: don't scan past a binary exponent if not accepted syntactically</title>
<updated>2015-02-14T01:01:19+00:00</updated>
<author>
<name>Robert Griesemer</name>
<email>gri@golang.org</email>
</author>
<published>2015-02-12T23:09:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=a809dc7adb8065368c73900a8256048c55cde79b'/>
<id>a809dc7adb8065368c73900a8256048c55cde79b</id>
<content type='text'>
TBR adonovan

Change-Id: I842cbc855dbd560f65e76c9a557dff1a22c5d610
Reviewed-on: https://go-review.googlesource.com/4882
Reviewed-by: Robert Griesemer &lt;gri@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
TBR adonovan

Change-Id: I842cbc855dbd560f65e76c9a557dff1a22c5d610
Reviewed-on: https://go-review.googlesource.com/4882
Reviewed-by: Robert Griesemer &lt;gri@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>math/big: split rat conversion routines and tests into separate files</title>
<updated>2015-01-30T23:02:51+00:00</updated>
<author>
<name>Robert Griesemer</name>
<email>gri@golang.org</email>
</author>
<published>2015-01-30T22:20:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=20a96a1f68cfe608b8066f3ee1b0db28d1d3e4e0'/>
<id>20a96a1f68cfe608b8066f3ee1b0db28d1d3e4e0</id>
<content type='text'>
No other functional changes.

Change-Id: I8be1fc488caa4f3d4c00afcb8c00475bfcd10709
Reviewed-on: https://go-review.googlesource.com/3673
Reviewed-by: Alan Donovan &lt;adonovan@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
No other functional changes.

Change-Id: I8be1fc488caa4f3d4c00afcb8c00475bfcd10709
Reviewed-on: https://go-review.googlesource.com/3673
Reviewed-by: Alan Donovan &lt;adonovan@google.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
