Documentation
¶
Index ¶
- Variables
- type Config
- func (c *Config) Base() (inputBase, outputBase int)
- func (c *Config) BigOrigin() *big.Int
- func (c *Config) CPUTime() (real, user, sys time.Duration)
- func (c *Config) Debug(flag string) int
- func (c *Config) ErrOutput() io.Writer
- func (c *Config) FloatFormat() (verb byte, prec int, ok bool)
- func (c *Config) FloatPrec() uint
- func (c *Config) Format() string
- func (c *Config) InputBase() int
- func (c *Config) Location() *time.Location
- func (c *Config) LocationAt(t time.Time) *time.Location
- func (c *Config) LockRandom()
- func (c *Config) MaxBits() uint
- func (c *Config) MaxDigits() uint
- func (c *Config) MaxStack() uint
- func (c *Config) Mobile() bool
- func (c *Config) Origin() int
- func (c *Config) Output() io.Writer
- func (c *Config) OutputBase() int
- func (c *Config) PrintCPUTime() string
- func (c *Config) Prompt() string
- func (c *Config) Random() *rand.Rand
- func (c *Config) RandomSeed() int64
- func (c *Config) RatFormat() string
- func (c *Config) SetBase(inputBase, outputBase int)
- func (c *Config) SetCPUTime(real, user, sys time.Duration)
- func (c *Config) SetDebug(flag string, state int) bool
- func (c *Config) SetErrOutput(output io.Writer)
- func (c *Config) SetFloatPrec(prec uint)
- func (c *Config) SetFormat(s string)
- func (c *Config) SetLocation(zone string) error
- func (c *Config) SetMaxBits(digits uint)
- func (c *Config) SetMaxDigits(digits uint)
- func (c *Config) SetMaxStack(depth uint)
- func (c *Config) SetMobile(mobile bool)
- func (c *Config) SetOrigin(origin int)
- func (c *Config) SetOutput(output io.Writer)
- func (c *Config) SetPrompt(prompt string)
- func (c *Config) SetRandomSeed(seed int64)
- func (c *Config) TimeZone() string
- func (c *Config) Tracing(level int) bool
- func (c *Config) UnlockRandom()
Constants ¶
This section is empty.
Variables ¶
var DebugFlags = [...]string{
"cpu",
"panic",
"parse",
"tokens",
"trace",
"types",
}
Order here determines order in the Config.debug array.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
A Config holds information about the configuration of the system. The zero value of a Config represents the default values for all settings.
func (*Config) Debug ¶
Debug returns the value of the specified debugging flag, -1 if the flag is unknown.
func (*Config) FloatFormat ¶
FloatFormat returns the parsed information about the format, if it's a floating-point format.
func (*Config) FloatPrec ¶
FloatPrec returns the floating-point precision in bits. The exponent size is fixed by math/big.
func (*Config) Format ¶
Format returns the formatting string. If empty, the default formatting is used, as defined by the bases.
func (*Config) LocationAt ¶ added in v0.3.3
LocationAt returns the time.Location in effect at the given time in the configured time zone, considering Daylight Savings Time and similar irregularities.
func (*Config) LockRandom ¶ added in v0.3.9
func (c *Config) LockRandom()
LockRandom serializes access to the random number generator. Needed because pfor can cause concurrent calls to the generator.
func (*Config) MaxDigits ¶
MaxDigits returns the maximum integer size to print as integer, in digits.
func (*Config) PrintCPUTime ¶
PrintCPUTime returns a nicely formatted version of the CPU time.
func (*Config) RandomSeed ¶
RandomSeed returns the seed used to initialize the random number generator.
func (*Config) SetCPUTime ¶
SetCPUTime sets the duration of the last interactive operation.
func (*Config) SetDebug ¶
SetDebug sets the value of the specified boolean debugging flag. It returns false if the flag is unknown.
func (*Config) SetErrOutput ¶
SetErrOutput sets the writer to which error output is printed; default is os.Stderr.
func (*Config) SetFloatPrec ¶
SetFloatPrec sets the floating-point precision in bits.
func (*Config) SetFormat ¶
SetFormat sets the formatting string. Rational formatting is just this format applied twice with a / in between.
func (*Config) SetLocation ¶ added in v0.3.3
SetLocation sets the time zone (and associated location) to the named location at the current time.
func (*Config) SetMaxBits ¶
SetMaxBits sets the maximum integer size to store, in bits.
func (*Config) SetMaxDigits ¶
SetMaxDigits sets the maximum integer size to print as integer, in digits.
func (*Config) SetMaxStack ¶ added in v0.1.1
SetMaxStack sets the maximum call stack depth.
func (*Config) SetOutput ¶
SetOutput sets the writer to which program output is printed; default is os.Stdout.
func (*Config) SetRandomSeed ¶
SetRandomSeed sets the seed for the random number generator.
func (*Config) Tracing ¶ added in v0.3.10
Tracing reports whether the tracing level is set at or above level.
func (*Config) UnlockRandom ¶ added in v0.3.9
func (c *Config) UnlockRandom()
UnlockRandom releases the lock on the random number generator.