func (c *NaiveCounter) Add(delta float64) {
	*c += NaiveCounter(delta)
}
Add ignores the non-integer part of delta.
package concurrentcount
import (
	"math"
	"sync"
	"sync/atomic"
)
type Counter interface {
	Get() float64
	Inc()
	Add(float64)
}
type MutexCounter struct {
	mtx   sync.Mutex
	value float64
}
func (c *MutexCounter) Get() float64 {
	c.mtx.Lock()
	defer c.mtx.Unlock()
	return c.value
}
func (c *MutexCounter) Inc() {
	c.mtx.Lock()
	defer c.mtx.Unlock()
	c.value++
}
func (c *MutexCounter) Add(delta float64) {
	c.mtx.Lock()
	defer c.mtx.Unlock()
	c.value += delta
}
type RWMutexCounter struct {
	mtx   sync.RWMutex
	value float64
}
func (c *RWMutexCounter) Get() float64 {
	c.mtx.RLock()
	defer c.mtx.RUnlock()
	return c.value
}
func (c *RWMutexCounter) Inc() {
	c.mtx.Lock()
	defer c.mtx.Unlock()
	c.value++
}
func (c *RWMutexCounter) Add(delta float64) {
	c.mtx.Lock()
	defer c.mtx.Unlock()
	c.value += delta
}
type AtomicIntCounter int64
func (c *AtomicIntCounter) Get() float64 {
	return float64(atomic.LoadInt64((*int64)(c)))
}
func (c *AtomicIntCounter) Inc() {
	atomic.AddInt64((*int64)(c), 1)
}
func (c *AtomicIntCounter) Add(delta float64) {
	atomic.AddInt64((*int64)(c), int64(delta))
}
type NaiveCounter float64
func (c *NaiveCounter) Get() float64 {
	return float64(*c)
}
func (c *NaiveCounter) Inc() {
	(*c)++
}