Basic30 Language Reference
Float Function

Returns a number as a Single type value.

Float (expression)
expression
Required. A number or numeric expression

Requirements

  1. This function requires the link time library "libm.a".  It is a free download from the Microchip website.
  2. The flie <libs/math.bas> must be included in the Basic source to use this function.

Example

#include <libs/math.bas>

Dim a as Single
Dim i as Long

i=543
a=Float(i)   ' a is now 543.0

Also See: Int