Commit Graph

17 Commits

Author SHA1 Message Date
Clayton Coleman
b2a01d4d94
Add an int64 quantity implementation
Provides fast transformations of int64 scaled values with overflow to
inf.Dec as needed. Attempts to reduce allocations and expensive
operations in the critical path.

Alters the public signature of Quantity to encourage more efficient use
2016-05-19 08:41:39 -04:00
saadali
b83af3d481 Change "speter.net/go/exp/math/dec/inf" dependency
to "https://gopkg.in/inf.v0"
2016-05-11 17:01:28 -07:00
Clayton Coleman
cb3a479ed7
Add quantity benchmarks 2016-05-05 18:06:19 -04:00
derekwaynecarr
2ad322f295 Add or subtract from zero should not lose format 2016-02-04 13:16:47 -05:00
Tim St. Clair
40e90886e6 Add micro- and nano- suffixes 2016-01-04 14:08:24 -08:00
Tim St. Clair
b4116eb718 Handle nil Amount in resource.Quantity.{Add,Sub}
Treat `nil` Amount as 0 in `resource.Quantity.Add` and
`resource.Quantity.Sub`. Also, allow adding/subtracting resources with
different Formats (since Format has no effect on the underlying value).
2015-12-10 19:24:23 -08:00
derekwaynecarr
ea919f6d1e Fix precision handling in validating LimitRange 2015-09-09 15:52:29 -04:00
Jian Huang
c350d325e9 Solve Static Check Error 2015-08-19 13:38:56 +08:00
derekwaynecarr
6968a4e0df Improve quota describe output 2015-06-03 15:16:24 -04:00
Eric Paris
6b3a6e6b98 Make copyright ownership statement generic
Instead of saying "Google Inc." (which is not always correct) say "The
Kubernetes Authors", which is generic.
2015-05-01 17:49:56 -04:00
Daniel Smith
5767b41b28 make quantity flag work with pflag package 2015-01-14 15:16:53 -08:00
Daniel Smith
cd58e49c78 remove 'i' and nasty rounding; test 2015-01-06 16:13:17 -08:00
Daniel Smith
2d2df5593c Add examples & clarify comments further 2015-01-06 15:18:22 -08:00
Daniel Smith
b7b2ee34de add flag helper func 2015-01-05 17:35:41 -08:00
Daniel Smith
6c6cdac0e9 Add accessor functions; round-trip test 2015-01-05 17:35:41 -08:00
Daniel Smith
18b896645c Saturation + test, also test negative numbers 2015-01-05 17:20:38 -08:00
Daniel Smith
394c9452e7 Start numeric type for resources 2015-01-05 17:20:38 -08:00