A lot of changes. Main ones are:
- fraction type renamed as FractionType and moved from operator-fraction.go to fraction-type.go - ListType moved from operator-list.go to list-type.go - all test file were renamed adding the "t_" prefix - defined a test template in file t_temple_test.go - new test file t_relational_test.go where relational tests are collected - lists can now compared as set using operators <, <=, >, and >= (IMPORTANT: here = menas same content, not same list)
This commit is contained in:
@@ -40,12 +40,12 @@ func IsDict(v any) (ok bool) {
|
||||
}
|
||||
|
||||
func IsFract(v any) (ok bool) {
|
||||
_, ok = v.(*fraction)
|
||||
_, ok = v.(*FractionType)
|
||||
return ok
|
||||
}
|
||||
|
||||
func IsRational(v any) (ok bool) {
|
||||
if _, ok = v.(*fraction); !ok {
|
||||
if _, ok = v.(*FractionType); !ok {
|
||||
_, ok = v.(int64)
|
||||
}
|
||||
return ok
|
||||
@@ -76,7 +76,7 @@ func isIterator(v any) (ok bool) {
|
||||
func numAsFloat(v any) (f float64) {
|
||||
var ok bool
|
||||
if f, ok = v.(float64); !ok {
|
||||
if fract, ok := v.(*fraction); ok {
|
||||
if fract, ok := v.(*FractionType); ok {
|
||||
f = fract.toFloat()
|
||||
} else {
|
||||
i, _ := v.(int64)
|
||||
|
||||
Reference in New Issue
Block a user