Documentation ¶
Overview ¶
Package xmath provides math-related utilities.
Index ¶
- Constants
- func AbsInt(x int) int
- func MaxInt(a, b int) int
- func MinInt(a, b int) int
- type BitSet
- func (b *BitSet) Clear(index int)
- func (b *BitSet) ClearRange(start, end int)
- func (b *BitSet) Clone() *BitSet
- func (b *BitSet) Copy(other *BitSet)
- func (b *BitSet) Count() int
- func (b *BitSet) Data() []uint64
- func (b *BitSet) EnsureCapacity(words int)
- func (b *BitSet) Equal(other *BitSet) bool
- func (b *BitSet) FirstSet() int
- func (b *BitSet) Flip(index int)
- func (b *BitSet) FlipRange(start, end int)
- func (b *BitSet) LastSet() int
- func (b *BitSet) Load(data []uint64)
- func (b *BitSet) NextClear(start int) int
- func (b *BitSet) NextSet(start int) int
- func (b *BitSet) PreviousClear(start int) int
- func (b *BitSet) PreviousSet(start int) int
- func (b *BitSet) Reset()
- func (b *BitSet) Set(index int)
- func (b *BitSet) SetRange(start, end int)
- func (b *BitSet) State(index int) bool
- func (b *BitSet) Trim()
Constants ¶
const ( // DegreesToRadians converts a value in degrees to radians when multiplied // with the value. DegreesToRadians = math.Pi / 180 // RadiansToDegrees converts a value in radians to degrees when multiplied // with the value. RadiansToDegrees = 180 / math.Pi )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BitSet ¶
type BitSet struct {
// contains filtered or unexported fields
}
BitSet contains a set of bits.
func (*BitSet) ClearRange ¶
ClearRange clears the bits from 'start' to 'end', inclusive.
func (*BitSet) EnsureCapacity ¶
EnsureCapacity ensures that the BitSet has enough underlying storage to accommodate setting a bit as high as index position 'words' x 64 - 1 without needing to allocate more storage.
func (*BitSet) FirstSet ¶
FirstSet returns the first set bit. If no bits are set, then -1 is returned.
func (*BitSet) NextSet ¶
NextSet returns the next set bit starting from 'start'. If no bits are set at or beyond 'start', then -1 is returned.
func (*BitSet) PreviousClear ¶
PreviousClear returns the previous clear bit starting from 'start'. If no bits are clear at or before 'start', then -1 is returned.
func (*BitSet) PreviousSet ¶
PreviousSet returns the previous set bit starting from 'start'. If no bits are set at or before 'start', then -1 is returned.
Directories ¶
Path | Synopsis |
---|---|
Package fixed provides fixed-point values that can be added, subtracted, multiplied and divided.
|
Package fixed provides fixed-point values that can be added, subtracted, multiplied and divided. |
Package geom provides geometry primitives.
|
Package geom provides geometry primitives. |
Package geom32 provides geometry primitives.
|
Package geom32 provides geometry primitives. |
Package rand provides a Randomizer based upon the crypto/rand package.
|
Package rand provides a Randomizer based upon the crypto/rand package. |