1
0
mirror of https://github.com/golang/go synced 2024-11-18 18:04:46 -07:00

go.tools/go/exact: tweaked documentation

LGTM=adonovan
R=adonovan
CC=golang-codereviews
https://golang.org/cl/88630043
This commit is contained in:
Robert Griesemer 2014-04-16 13:07:59 -07:00
parent 83a7488b3d
commit 1961019b8c

View File

@ -2,12 +2,14 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package exact implements mathematically exact values
// and operations for untyped Go constant values.
// Package exact implements Values representing untyped
// Go constants and the corresponding operations. Values
// and operations have unlimited precision.
//
// A special Unknown value may be used when a constant
// value is unknown due to an error; operations on unknown
// values produce unknown values.
// A special Unknown value may be used when a value
// is unknown due to an error. Operations on unknown
// values produce unknown values unless specified
// otherwise.
//
package exact
@ -38,7 +40,7 @@ const (
Complex
)
// A Value represents a mathematically precise value of a given Kind.
// A Value represents a mathematically exact value of a given Kind.
type Value interface {
// Kind returns the value kind; it is always the smallest
// kind in which the value can be represented exactly.
@ -379,7 +381,8 @@ func MakeFromBytes(bytes []byte) Value {
// Support for disassembling fractions
// Num returns the numerator of x; x must be Int, Float, or Unknown.
// If x is Unknown, the result is Unknown, otherwise it is an Int.
// If x is Unknown, the result is Unknown, otherwise it is an Int
// with the same sign as x.
func Num(x Value) Value {
switch x := x.(type) {
case unknownVal, int64Val, intVal: