/
const.go
33 lines (24 loc) · 1.11 KB
/
const.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
* This file is subject to the terms and conditions defined in
* file 'LICENSE.md', which is part of this source code package.
*/
package ps
import (
"errors"
)
// tolerance specifies the tolerance for equivalence when comparing real values.
const tolerance = 0.000001
// ErrStackUnderflow is due to a stack underflow.
var ErrStackUnderflow = errors.New("stack underflow")
// ErrStackOverflow is due to a stack overflow.
var ErrStackOverflow = errors.New("stack overflow")
// ErrTypeCheck is due to a type mismatch, typically when a type is expected as input but a different type
// is received instead.
var ErrTypeCheck = errors.New("type check error")
// ErrRangeCheck occurs when an input value is incorrect or within valid boundaeries.
var ErrRangeCheck = errors.New("range check error")
// ErrUnsupportedOperand occurs when an unsupported operand is encountered.
var ErrUnsupportedOperand = errors.New("unsupported operand")
// ErrUndefinedResult occurs when the function does not have a result for given input parameters. An example
// is division by 0.
var ErrUndefinedResult = errors.New("undefined result error")