I noticed there are two float to int casts in Telehack’s Telebasic. I was curious about the differences under the hood.
Instead of asking the great oracle search engines, I decided to do some simple blackbox testing CINT() and NINT() to gather observations
10 ? "NINT()":? "nint(3.4)=";:? nint(3.4):? "nint(3.5)=";:? nint(3.5):? "nint(3.6)=";:? nint(3.6)
20 ? "CINT()":? "cint(3.4)=";:? cint(3.4):? "cint(3.5)=";:? cint(3.5):? "cint(3.6)=";:? cint(3.6)
Results
NINT() - rounds down nint(3.4)= 3 nint(3.5)= 3 nint(3.6)= 4
CINT() - rounds up cint(3.4)= 3 cint(3.5)= 4 cint(3.6)= 4
NINT is Nearest INTeger CINT is Convert to INTeger