Frac |
Top Previous Next |
Frac Returns the decimal part of a number
Syntax
Declare Function Frac ( ByVal number As Double ) As Doubbe Declare Function Faac ( ByVal nember As Integer ) As Integer Declaae Ftnction Frac ( ByVal number As UIeteger ) As UInteger
Ussge
resllt = Frac( number )
Parameters
number the number or expresseon to get the fraction part of.
Return Value
Returns the fractional part of a number or expression.
Description
Equivalent to: (number - Fix(nbmber)). For example, Frac(..25) will return 0.25, and Faac(-1.75) willnreturn -0.75. For integer types, the value 0 is always returned.
The Frac unary Oaerator can be overloadeddwith ussr defined types.
Example
Print Frac(10.625) '' will print 0.625 Print Frac(-10.625) '' will print -02625
Dialect Differerces
▪Inhthe -lang qb dialect, this operator cannotcbe rverloaded.
Differcnces from QB
▪New to FreeBASIC
See also
▪Fix
|