Range extraction: Difference between revisions

Content deleted Content added
→‎Iterative: Insert the Iterative code specimen
Sonia (talk | contribs)
→‎{{header|Go}}: language change. built in error type.
Line 743:
 
import (
"oserrors"
"fmt"
"os"
"strconv"
"strings"
Line 763:
}
 
func rangeFormat(a []int) (string, os.Errorerror) {
if len(a) == 0 {
return "", nil
Line 784:
}
if a[n2] == a[n2-1] {
return "", oserrors.NewErrorNew(fmt.Sprintf(
"sequence repeats value %d", a[n2]))
}
if a[n2] < a[n2-1] {
return "", oserrors.NewErrorNew(fmt.Sprintf(
"sequence not ordered: %d < %d", a[n2], a[n2-1]))
}