sync: If step is undefined, use the default value
This commit is contained in:
parent
e3762ffb1d
commit
b93c57f704
1 changed files with 4 additions and 0 deletions
|
@ -332,6 +332,10 @@ func buildExerciceFlag(i Importer, exercice *fic.Exercice, flag ExerciceFlag, nl
|
||||||
if rns, err := flag.RawNumber(); err != nil {
|
if rns, err := flag.RawNumber(); err != nil {
|
||||||
errs = multierr.Append(errs, NewFlagError(exercice, &flag, nline+1, fmt.Errorf("raw %w", err)))
|
errs = multierr.Append(errs, NewFlagError(exercice, &flag, nline+1, fmt.Errorf("raw %w", err)))
|
||||||
} else {
|
} else {
|
||||||
|
if fstep == 0 {
|
||||||
|
fstep = 1.0
|
||||||
|
}
|
||||||
|
|
||||||
for _, rn := range rns {
|
for _, rn := range rns {
|
||||||
v := math.Abs(rn) / fstep
|
v := math.Abs(rn) / fstep
|
||||||
if float64(int(v)) != v {
|
if float64(int(v)) != v {
|
||||||
|
|
Reference in a new issue