// NewDouble node constructor
341566
func NewDouble(Expr node.Node) *Double {
	return &Double{
		FreeFloating: nil,
		Expr:         Expr,
	}
}
904101
func NewPreDec(Variable node.Node) *PreDec {
	return &PreDec{
		FreeFloating: nil,
		Variable:     Variable,
	}
}
409879
func NewLogicalOr(Variable node.Node, Expression node.Node) *LogicalOr {
	return &LogicalOr{
		FreeFloating: nil,
		Left:         Variable,
		Right:        Expression,
	}
}
1283389
func NewDoubleArray(seqs [][]string) *DoubleArray {
	da := &DoubleArray{Encoding: make(map[string]int)}
	if len(seqs) == 0 {
		return da
	}

	encoded := registerTokens(da, seqs)
	sort.Sort(byLex(encoded))

	root := node{row: -1, col: -1, left: 0, right: len(encoded)}
	addSeqs(da, encoded, 0, root)

	for i := len(da.Base); i > 0; i-- {
		if da.Check[i-1] != 0 {
			da.Base = da.Base[:i]
			da.Check = da.Check[:i]
			break
		}
	}
	return da
}
1080827
func (s *Value) SetDoubleValue(v float64) *Value {
	s.DoubleValue = &v
	return s
}
1267966
func NewDoubleFieldDescriptor(nullable NullableColumn, metadata []byte) (
	fd FieldDescriptor,
	remaining []byte,
	err error) {

	if len(metadata) < 1 {
		return nil, nil, errors.New("metadata too short")
	}

	size := uint8(metadata[0])
	if size != 8 {
		return nil, nil, errors.New("invalid double size")
	}

	return newFixedLengthFieldDescriptor(
			mysql_proto.FieldType_DOUBLE,
			nullable,
			8,
			func(b []byte) interface{} { return LittleEndian.Float64(b) }),
		metadata[1:],
		nil
}
170413
func NewNodeAffinityIterator(ctx Context, source RankIterator) *NodeAffinityIterator {
	return &NodeAffinityIterator{
		ctx:    ctx,
		source: source,
	}
}
952040
func newMainNode(x *sNode, xhc uint32, y *sNode, yhc uint32, lev uint, gen *generation) *mainNode {
	if lev < exp2 {
		xidx := (xhc >> lev) & 0x1f
		yidx := (yhc >> lev) & 0x1f
		bmp := uint32((1 << xidx) | (1 << yidx))

		if xidx == yidx {
			// Recurse when indexes are equal.
			main := newMainNode(x, xhc, y, yhc, lev+w, gen)
			iNode := &iNode{main: main, gen: gen}
			return &mainNode{cNode: &cNode{bmp, []branch{iNode}, gen}}
		}
		if xidx < yidx {
			return &mainNode{cNode: &cNode{bmp, []branch{x, y}, gen}}
		}
		return &mainNode{cNode: &cNode{bmp, []branch{y, x}, gen}}
	}
	l := list.Empty.Add(x).Add(y)
	return &mainNode{lNode: &lNode{l}}
}
270982
func NewUnsignedPermanode() *Builder {
	bb := base(1, "permanode")
	chars := make([]byte, 20)
	_, err := io.ReadFull(rand.Reader, chars)
	if err != nil {
		panic("error reading random bytes: " + err.Error())
	}
	bb.m["random"] = base64.StdEncoding.EncodeToString(chars)
	return bb
}
1231928
func (p *TCompactProtocol) ReadDouble() (value float64, err error) {
	longBits := make([]byte, 8)
	_, e := io.ReadFull(p.trans, longBits)
	if e != nil {
		return 0.0, NewTProtocolException(e)
	}
	return math.Float64frombits(p.bytesToUint64(longBits)), nil
}
452646
func newNode() *Node {
	return &Node{
		exists: false,
		value:  nil,
		child:  make(map[rune]*Node),
	}
}
93351
func NewPrintNode(exp Expr, p Pos) *PrintNode {
	return &PrintNode{p, TrimmableNode{}, exp}
}
451763
func newNodeValue(value interface{}) *node {
	n := newNode()
	n.value = value
	n.children = nil
	return n
}
530627
func NewEmbedNode(tmpl Expr, with Expr, only bool, blocks map[string]*BlockNode, pos Pos) *EmbedNode {
	return &EmbedNode{NewIncludeNode(tmpl, with, only, pos), blocks}
}
424455
func NewDoubleTsCell(v float64) TsCell {
	tsc := riak_ts.TsCell{DoubleValue: &v}
	tsct := riak_ts.TsColumnType_DOUBLE
	return TsCell{columnType: tsct, cell: &tsc}
}
589251
func (xmlNode *XmlNode) AddNextSibling(data interface{}) (err error) {
	switch t := data.(type) {
	default:
		if nodes, err := xmlNode.coerce(data); err == nil {
			for i := len(nodes) - 1; i >= 0; i-- {
				node := nodes[i]
				if err = xmlNode.addNextSibling(node); err != nil {
					break
				}
			}
		}
	case *DocumentFragment:
		if nodes, err := xmlNode.coerce(data); err == nil {
			for i := len(nodes) - 1; i >= 0; i-- {
				node := nodes[i]
				if err = xmlNode.addNextSibling(node); err != nil {
					break
				}
			}
		}
	case Node:
		err = xmlNode.addNextSibling(t)
	}
	return
}
998242
func newNode(cmp common.Comparator, maxLevels uint8) *node {
	return &node{
		entry:   cmp,
		forward: make(nodes, maxLevels),
		widths:  make(widths, maxLevels),
	}
}