go-hep.org/x/hep@v0.38.1/fastjet/internal/predicates/bigfunctions.go (about)

     1  // Copyright ©2017 The go-hep Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package predicates
     6  
     7  import (
     8  	"math/big"
     9  )
    10  
    11  var (
    12  	one = new(big.Rat).SetInt64(1)
    13  )
    14  
    15  func setBig(f float64) *big.Rat {
    16  	return new(big.Rat).SetFloat64(f)
    17  }
    18  
    19  func bigAdd(a, b *big.Rat) *big.Rat {
    20  	return new(big.Rat).Add(a, b)
    21  }
    22  
    23  func bigSub(a, b *big.Rat) *big.Rat {
    24  	return new(big.Rat).Sub(a, b)
    25  }
    26  
    27  func bigMul(a, b *big.Rat) *big.Rat {
    28  	return new(big.Rat).Mul(a, b)
    29  }