Code: Select all

```
'Integer test on cropped number ratio
'by Ton Nillesen, October 2019
'
{/Extensions/Math/! Math utils} ' Include lib
OPTION TAB 15
D=0.5
PRINT "D =";D
PRINT " I"," I/D","Math Odd+Even"
FOR i=-0.5 TO 0.5 STEP 0.1
R=i/d ' crop needed, else wrong result
R=Math_Crop(i/d,9) ' trim mantissa to 9 significant digits
PRINT i,r,MATh ODD(r)+MATH EVEN(r)
NEXT i
END
```

20191125

ODD and EVEN replaced by built-in MATH ODD and EVEN

Math_Crop() still needed