Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
v3:int [2021/09/22 09:46] – created neilsv3:int [2023/08/22 13:32] (current) – [FLOOR] neils
Line 1: Line 1:
-====== INT ======+====== FLOOR ======
  
-The INT() function returns the integer part of a floating point value, as floating point.+The ''FLOOR()'' function returns the integer part of a floating point value, also as floating point number.
  
 +<adm note>
 +The function is equivalent to CBM BASIC's ''INT()'' function. However, it has a different name in XC=BASIC due to conflict with the ''INT'' keyword.
 +</adm>
 ===== Function header ===== ===== Function header =====
  
-  DECLARE FUNCTION INT AS FLOAT (num AS FLOAT) SHARED STATIC INLINE+  DECLARE FUNCTION FLOOR AS FLOAT (num AS FLOAT) SHARED STATIC INLINE
  
 ===== Example ===== ===== Example =====
  
-  PRINT INT(3.14159) : REM outputs 3+  PRINT FLOOR(3.14159) : REM outputs 3
  
 <adm note> <adm note>
 To convert a floating point number to integer type, see [[v3:cint|]]. To convert a floating point number to integer type, see [[v3:cint|]].
 </adm> </adm>