1
0
mirror of https://github.com/golang/go synced 2024-10-04 16:31:22 -06:00
Commit Graph

83 Commits

Author SHA1 Message Date
Mike Rosset
8ddd66145e build: clear execute bit from Go files
R=golang-dev, rsc
CC=golang-dev, mike.rosset
https://golang.org/cl/4950062
2011-09-05 07:48:42 -04:00
Volker Dobler
f78e7d36a6 math: fix Pow10 loop
Pow10 failed for MinInt32 (endless loop until out of
memory).  Fix by returning 0 and +Inf for all arguments
where the result is not representable in a float64.
Fixes #2159.

R=rsc
CC=golang-dev
https://golang.org/cl/4930041
2011-08-24 13:59:52 -04:00
Robert Griesemer
90564a9256 go/printer: changed max. number of newlines from 3 to 2
manual changes in src/pkg/go/printer, src/cmd/gofix/signal_test.go
(cd src/cmd/gofix/testdata; gofmt -w *.in *.out)
(cd src/pkg/go/printer; gotest -update)
gofmt -w misc src

runs all tests

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4715041
2011-07-14 14:39:40 -07:00
Fan Hongjian
fc41e621e8 math: add sqrt_arm.s and sqrtGoC.go as fallback to soft fp emulation
5a: add SQRTF and SQRTD
5l: add ASQRTF and ASQRTD

Use ARMv7 VFP VSQRT instruction to speed up math.Sqrt

R=rsc, dave, m
CC=golang-dev
https://golang.org/cl/4551082
2011-06-09 17:19:08 -04:00
Robert Hencke
3fbd478a8a pkg: spelling tweaks, I-Z
also, a few miscellaneous fixes to files outside pkg

R=golang-dev, dsymonds, mikioh.mikioh, r
CC=golang-dev
https://golang.org/cl/4517116
2011-05-30 18:02:59 +10:00
Nigel Tao
6a186d38d1 src/pkg: make package doc comments consistently start with "Package foo".
R=rsc
CC=golang-dev
https://golang.org/cl/4442064
2011-04-20 09:57:05 +10:00
Russ Cox
f2b5a07453 delete float, complex - code changes
also:
	cmplx -> complex
	float64(1.0) -> 1.0
	float64(1) -> 1.0

R=gri, r, gri1, r2
CC=golang-dev
https://golang.org/cl/3991043
2011-01-19 23:09:00 -05:00
Eoghan Sherry
13c2e62966 math: handle denormals in Frexp, Ilogb, Ldexp, and Logb
Also:
* document special cases for Frexp and Ldexp
* handle ±Inf in Ldexp
* correctly return -0 on underflow in Ldexp
* test special cases for Ldexp
* test boundary cases for Frexp, Ilogb, Ldexp, and Logb

R=rsc
CC=golang-dev
https://golang.org/cl/3676041
2011-01-19 14:23:59 -05:00
Eoghan Sherry
976e45726c math: change float64 bias constant from 1022 to 1023
This makes some subtle code easier to understand.

R=rsc
CC=golang-dev
https://golang.org/cl/3444043
2010-12-15 13:20:52 -05:00
Russ Cox
9282a768cf math: s/MinFloat/SmallestNonzeroFloat/
R=r, gri
CC=golang-dev
https://golang.org/cl/3547042
2010-12-10 11:39:09 -08:00
Eoghan Sherry
ff4e08f60d math: improve accuracy of Exp2
Note:
* Exp2 doesn't have a special case for very small arguments
* Exp2 hasn't been subject to a proper error analysis

Also:
* add tests for Exp2 with integer argument
* always test Go versions of Exp and Exp2

R=rsc
CC=Charlie Dorian, PeterGo, golang-dev
https://golang.org/cl/3481041
2010-12-06 16:24:51 -05:00
Robert Griesemer
3478891d12 gofmt -s -w src misc
R=r, rsc
CC=golang-dev
https://golang.org/cl/2662041
2010-10-22 10:06:33 -07:00
Charles L. Dorian
b233ac8f18 math: Fix off-by-one error in Ilogb and Logb.
Fixes #1141.

R=rsc
CC=adg, golang-dev
https://golang.org/cl/2194047
2010-09-28 10:15:21 -04:00
Rob Pike
1959c3ac5b tests: fix prints
- delete unnecessary newlines
- make sure formatted prints call the formatting routines

R=adg
CC=golang-dev
https://golang.org/cl/2225046
2010-09-23 13:48:56 +10:00
Russ Cox
6e6fc67425 math: make portable Tan(Pi/2) return NaN
The panic NaN was a translation error.
The earliest version said panic "return sys.NaN()",
and when sys.NaN came along, it changed
to "panic sys.NaN()" instead of "return sys.NaN()".

R=r
CC=golang-dev
https://golang.org/cl/2106049
2010-09-11 23:41:25 -04:00
Charles L. Dorian
bead166a7c math: amd64 version of Sincos
R=rsc
CC=golang-dev
https://golang.org/cl/1939042
2010-08-26 19:03:58 -04:00
Russ Cox
da392d9136 build: no required environment variables
R=adg, r, PeterGo
CC=golang-dev
https://golang.org/cl/1942044
2010-08-18 10:08:49 -04:00
Charles L. Dorian
c8c2bdbc59 math: fix amd64 Hypot.
Underflow/overflow tests for exp_amd64.s

Fixes #957.

R=rsc
CC=golang-dev
https://golang.org/cl/1817041
2010-08-06 16:50:48 -07:00
Charles L. Dorian
c28bd5445c math: amd64 version of log
Benchmarks 25ns/op (was 58ns/op) on 2.53GHz Intel Core 2 Duo.

R=rsc
CC=golang-dev
https://golang.org/cl/1740043
2010-07-12 11:30:11 -07:00
Charles L. Dorian
a0117bafa0 math: amd64 versions of exp and fabs
Benchmark of exp to 28 ns/op from 64 ns/op,
on 2.53GHz Intel Core 2 Duo.

R=rsc
CC=golang-dev
https://golang.org/cl/1594041
2010-06-30 14:44:27 -07:00
Russ Cox
565b5dc076 gc: new typechecking rules
* Code for assignment, conversions now mirrors spec.
* Changed some snprint -> smprint.
* Renamed runtime functions to separate
  interface conversions from type assertions:
  convT2I, assertI2T, etc.
* Correct checking of \U sequences.

Fixes #840.
Fixes #830.
Fixes #778.

R=ken2
CC=golang-dev
https://golang.org/cl/1303042
2010-06-08 18:50:02 -07:00
Charles L. Dorian
3fb8d2ad84 math: fix typo in Exp2 benchmark
Was timing Exp, not Exp2.

R=rsc, r
CC=golang-dev
https://golang.org/cl/1521042
2010-06-03 15:04:22 -07:00
Charles L. Dorian
3d4c97b82c math: Pow special cases (signed zero, IEEE 754-2008)
Also added more tests for acosh, hypot, log, log10, log2
in all_test.go.

R=rsc
CC=golang-dev
https://golang.org/cl/1417041
2010-06-02 20:55:47 -07:00
Charles L. Dorian
809479740f math: amd64 versions of fdim, fmax, fmin
Uses the SSE2 max, min instructions. Also shorter sqrt_amd64.s

R=rsc
CC=golang-dev
https://golang.org/cl/1216042
2010-05-18 22:33:50 -07:00
Charles L. Dorian
879241d819 math: signed zero Sqrt special case
IEEE 754 says: sqrt(-0) = -0

R=rsc
CC=golang-dev
https://golang.org/cl/1098041
2010-05-18 22:16:01 -07:00
Charles L. Dorian
37089cce67 math: fix typo in Cbrt description
R=rsc
CC=golang-dev
https://golang.org/cl/979043
2010-05-02 23:33:08 -07:00
Charles L. Dorian
22f84c5b2a math: more special cases for signed zero
R=rsc
CC=golang-dev
https://golang.org/cl/937042
2010-04-26 22:44:39 -07:00
Charles L. Dorian
3c3e68ba32 math: use ** for exponentiation in comments
R=rsc
CC=golang-dev
https://golang.org/cl/908041
2010-04-09 14:37:33 -07:00
Charles L. Dorian
9aa8f95ba8 math: atan2 special cases (negative zero)
Added Signbit(), revised Copysign()

R=rsc
CC=golang-dev
https://golang.org/cl/822045
2010-04-08 13:24:04 -07:00
Charles L. Dorian
1ec91c8d1d math: add J1, Y1, Jn and Yn (Bessel functions)
Also amend j0.go (variable name conflict, small corrections).

R=rsc
CC=golang-dev
https://golang.org/cl/769041
2010-03-26 14:09:39 -07:00
Charles L. Dorian
6b6c3993d5 math: add J0 and Y0 (Bessel functions)
R=rsc
CC=golang-dev
https://golang.org/cl/661044
2010-03-24 09:25:49 -07:00
Charles L. Dorian
26f0c83eb8 math: add Gamma function
R=rsc
CC=golang-dev
https://golang.org/cl/649041
2010-03-19 15:29:22 -07:00
Robert Griesemer
8107cad45a math, path: minor comment fixes
R=r
CC=golang-dev
https://golang.org/cl/444043
2010-03-11 16:40:32 -08:00
Robert Griesemer
2a62195153 math package: minor documentation fix
R=rsc
CC=golang-dev
https://golang.org/cl/424041
2010-03-10 17:04:43 -08:00
Charles L. Dorian
067fe2840b math: faster hypot
Use hardware sqrt for faster hypot; preserve software-only
hypot as hypotGo (like sqrtGo); enable benchmarking of
hypotGo.

R=rsc
CC=golang-dev
https://golang.org/cl/229049
2010-03-05 16:45:39 -08:00
Robert Griesemer
a145829873 frexp.go: remove html from comment
R=r
CC=golang-dev
https://golang.org/cl/250041
2010-03-05 10:30:50 -08:00
Charles L. Dorian
6b80a5fa6d math: added ilogb, logb, remainder, tests and special conditions
Also added expm1_386 and remainder_386; shortened exp_386

R=rsc
CC=golang-dev
https://golang.org/cl/217109
2010-03-03 18:17:13 -08:00
Robert Griesemer
dbe0b57012 go/printer, gofmt: correct indentation after certain /*-style comments
- applied gofmt to src and misc

Note: This fix improved formatting of src/pkg/math/all_test.go but leads
to a degradation in src/pkg/exp/4s/xs.go. The latter happened to "work"
before accidentally. Fixing the alignment in that case in general will
be a separate CL.

Fixes #628.

R=rsc
CC=golang-dev
https://golang.org/cl/223054
2010-02-25 13:47:16 -08:00
Charles L. Dorian
78e918ccba math: add lgamma; in-line special cases of acosh, nextafter
Added lgamma.go, tests and special cases.

R=rsc
CC=golang-dev
https://golang.org/cl/217060
2010-02-22 17:12:48 -08:00
Charles L. Dorian
c3fa32c747 math: add Cbrt and Sincos; x87 versions of Sincos, Frexp, Ldexp
Added special condition and benchmarks for Cbrt, Sincos. Took Frexp and Ldexp out of bits.go.

R=rsc
CC=golang-dev
https://golang.org/cl/206084
2010-02-18 23:33:15 -08:00
Charles L. Dorian
aee1434193 math: add Exp2; 386 FPU versions of Exp2 and Log1p
Added tests and benchmarks for Exp2 (special cases same
as Exp). Log1p also enhances speed of inverse hyperbolics.

R=rsc
CC=golang-dev
https://golang.org/cl/206058
2010-02-10 00:06:41 -08:00
Charles L. Dorian
c465331262 math: add functions Log2, Nextafter, Fdim, Fmax, Fmin
Add functions, tests and benchmarks. Fix typos in comments
in expm1 and hypot_386.  Fix Acosh domain error in benchmark
test.

R=rsc
CC=golang-dev
https://golang.org/cl/204069
2010-02-09 13:33:12 -08:00
Charles L. Dorian
072b560ee6 math: Atan2 special cases and tests; atan2_386
Added special cases, tests and benchmarks for Atan2;
added 386 FPU version of Atan2.

R=rsc
CC=golang-dev
https://golang.org/cl/201068
2010-02-05 14:55:19 -08:00
Charles L. Dorian
04217ee54e math: special cases for Modf, Frexp and Ldexp; added Modf_386
Also moved Modf from bits.go into modf.go and added timing tests.

R=rsc
CC=golang-dev
https://golang.org/cl/202042
2010-02-05 00:41:30 -08:00
Russ Cox
b13b80e555 math: change Cosh test to close, not veryclose (needed on some x86 chips)
R=r
CC=Charlie Dorian, golang-dev
https://golang.org/cl/199054
2010-02-01 22:46:37 -08:00
Charles L. Dorian
a0690b69da math: add functions; update tests and special cases
Added special cases to comments for asin.go and fabs.go.
Added Trunc() to floor.go and floor_386.s.  Fixed formatting
error in hypot_386.s  Added new functions Acosh, Asinh,
Atanh, Copysign, Erf, Erfc, Expm1, and Log1p.  Added
386 FPU version of Fmod.  Added tests, benchmarks, and
precision to expected results in all_test.go.  Edited
makefile so it all compiles.

R=rsc
CC=golang-dev
https://golang.org/cl/195052
2010-02-01 22:21:40 -08:00
Devon H. O'Dell
4ffbff14b3 math: Change veryclose to close for Sinh and Exp tests.
Fixes #550.

R=rsc
CC=eds, golang-dev, jtomaschke
https://golang.org/cl/196063
2010-01-29 12:54:05 -08:00
Charles L. Dorian
d4ca006334 math: 386 FPU hypot
Added 386 FPU version of Hypot; modified all_test.go to test
Hypot with large arguments.  Also edited sqrt.go to remove
Sqrt(0) as a special case.

R=rsc
CC=golang-dev
https://golang.org/cl/186180
2010-01-26 12:53:02 -08:00
Russ Cox
718be3215f in C and asm, replace pkg·name with ·name
(eliminate assumption of package global name space,
make code easier to move between packages).

R=r
CC=golang-dev
https://golang.org/cl/194072
2010-01-25 18:52:55 -08:00
Charles L. Dorian
9a6b8e21e4 math: special cases for Hypot
Added special case tests to all_test.go. Added tests to hypot.go,
otherwise hangs.

R=rsc
CC=golang-dev
https://golang.org/cl/186118
2010-01-15 13:21:47 -08:00