config

package
Version: v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2021 License: BSD-3-Clause Imports: 8 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DebugFlags = [...]string{
	"cpu",
	"panic",
	"parse",
	"tokens",
	"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) Base

func (c *Config) Base() (inputBase, outputBase int)

Base returns the input and output bases.

func (*Config) BigOrigin

func (c *Config) BigOrigin() *big.Int

BigOrigin returns the index origin as a *big.Int.

func (*Config) CPUTime

func (c *Config) CPUTime() time.Duration

CPUTime returns the duration of the last interactive operation.

func (*Config) Debug

func (c *Config) Debug(flag string) bool

Debug returns the value of the specified boolean debugging flag.

func (*Config) ErrOutput

func (c *Config) ErrOutput() io.Writer

ErrOutput returns the writer to be used for error output.

func (*Config) FloatFormat

func (c *Config) FloatFormat() (verb byte, prec int, ok bool)

FloatFormat returns the parsed information about the format, if it's a floating-point format.

func (*Config) FloatPrec

func (c *Config) FloatPrec() uint

FloatPrec returns the floating-point precision in bits. The exponent size is fixed by math/big.

func (*Config) Format

func (c *Config) Format() string

Format returns the formatting string. If empty, the default formatting is used, as defined by the bases.

func (*Config) InputBase

func (c *Config) InputBase() int

InputBase returns the input base.

func (*Config) MaxBits

func (c *Config) MaxBits() uint

MaxBits returns the maximum integer size to store, in bits.

func (*Config) MaxDigits

func (c *Config) MaxDigits() uint

MaxDigits returns the maximum integer size to print as integer, in digits.

func (*Config) MaxStack added in v0.1.1

func (c *Config) MaxStack() uint

MaxStack returns the maximum call stack depth.

func (*Config) Mobile added in v0.1.4

func (c *Config) Mobile() bool

Mobile reports whether we are running on a mobile platform.

func (*Config) Origin

func (c *Config) Origin() int

Origin returns the index origin, default 1.

func (*Config) Output

func (c *Config) Output() io.Writer

Output returns the writer to be used for program output.

func (*Config) OutputBase

func (c *Config) OutputBase() int

OutputBase returns the output base.

func (*Config) PrintCPUTime

func (c *Config) PrintCPUTime() string

PrintCPUTime returns a nicely formatted version of the CPU time, with 3 decimal places in whatever unit best fits. The default String method for Duration prints too many decimals.

func (*Config) Prompt

func (c *Config) Prompt() string

Prompt returns the interactive prompt.

func (*Config) Random

func (c *Config) Random() *rand.Rand

Random returns the generator for random numbers.

func (*Config) RandomSeed

func (c *Config) RandomSeed() int64

RandomSeed returns the seed used to initialize the random number generator.

func (*Config) RatFormat

func (c *Config) RatFormat() string

Format returns the formatting string for rationals.

func (*Config) SetBase

func (c *Config) SetBase(inputBase, outputBase int)

SetBase sets the input and output bases.

func (*Config) SetCPUTime

func (c *Config) SetCPUTime(d time.Duration)

SetCPUTime sets the duration of the last interactive operation.

func (*Config) SetDebug

func (c *Config) SetDebug(flag string, state bool) bool

SetDebug sets the value of the specified boolean debugging flag. It returns false if the flag is unknown.

func (*Config) SetErrOutput

func (c *Config) SetErrOutput(output io.Writer)

SetErrOutput sets the writer to which error output is printed; default is os.Stderr.

func (*Config) SetFloatPrec

func (c *Config) SetFloatPrec(prec uint)

SetFloatPrec sets the floating-point precision in bits.

func (*Config) SetFormat

func (c *Config) SetFormat(s string)

SetFormat sets the formatting string. Rational formatting is just this format applied twice with a / in between.

func (*Config) SetMaxBits

func (c *Config) SetMaxBits(digits uint)

MaxBits sets the maximum integer size to store, in bits.

func (*Config) SetMaxDigits

func (c *Config) SetMaxDigits(digits uint)

SetMaxDigits sets the maximum integer size to print as integer, in digits.

func (*Config) SetMaxStack added in v0.1.1

func (c *Config) SetMaxStack(depth uint)

SetMaxStack sets the maximum call stack depth.

func (*Config) SetMobile added in v0.1.4

func (c *Config) SetMobile(mobile bool)

SetMobile sets the Mobile bit as specified.

func (*Config) SetOrigin

func (c *Config) SetOrigin(origin int)

SetOrigin sets the index origin.

func (*Config) SetOutput

func (c *Config) SetOutput(output io.Writer)

SetOutput sets the writer to which program output is printed; default is os.Stdout.

func (*Config) SetPrompt

func (c *Config) SetPrompt(prompt string)

SetPrompt sets the interactive prompt.

func (*Config) SetRandomSeed

func (c *Config) SetRandomSeed(seed int64)

SetRandomSeed sets the seed for the random number generator.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL