Picomite/PicoMiteVGA V5.07.05 release candidates
Author | Message | ||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6006 |
DIM FLOAT n,k,s = 0.25 DIM INTEGER m PRINT " N INT(N) CINT(N) FIX(N) n\1 k\2 m" FOR n = -3 TO 3 STEP s m = n ' asign a float to an integer k = n * 2 PRINT STR$(n,2,2);TAB(8);INT(n);TAB(16);CINT(n);TAB(24);FIX(n);TAB(32);n\1;TAB(40);k\2;TAB(48);m NEXT n N INT(N) CINT(N) FIX(N) n\1 k\2 m -3.00 -3 -3 -3 -3 -3 -3 -2.75 -3 -3 -2 -3 -3 -3 -2.50 -3 -3 -2 -3 -2 -3 -2.25 -3 -2 -2 -2 -2 -2 -2.00 -2 -2 -2 -2 -2 -2 -1.75 -2 -2 -1 -2 -2 -2 -1.50 -2 -2 -1 -2 -1 -2 -1.25 -2 -1 -1 -1 -1 -1 -1.00 -1 -1 -1 -1 -1 -1 -0.75 -1 -1 0 -1 -1 -1 -0.50 -1 -1 0 -1 0 -1 -0.25 -1 0 0 0 0 0 0.00 0 0 0 0 0 0 0.25 0 0 0 0 0 0 0.50 0 1 0 1 0 1 0.75 0 1 0 1 1 1 1.00 1 1 1 1 1 1 1.25 1 1 1 1 1 1 1.50 1 2 1 2 1 2 1.75 1 2 1 2 2 2 2.00 2 2 2 2 2 2 2.25 2 2 2 2 2 2 2.50 2 3 2 3 2 3 2.75 2 3 2 3 3 3 3.00 3 3 3 3 3 3 lots of ways to convert to integer and all different To match the internal casting, use CINT() or n\1 Jim https://www.c-com.com.au/mmhelp/int.htm Edited 2022-11-04 06:03 by TassyJim |
||||