Lasso Soft Inc. > Home

[ decimal->modf ]

Method

Breaks a decimal into the integral and fractional parts, each of which has the same sign as the decimal.

Returns the fractional part and the integral part (as a floating-point number) as the first and second elements of a pair, respectively.

  • Syntax
Decimal Object->modf
Examples
  • Beginner

To return the integral and fractional parts of a decimal as a pair:

Use the [decimal->modf] method. The following example breaks the decimal into its integral and fractional parts, and returns them as the first and second elements of a pair, respectively.

Code

31415.9265->modf

Result

(0.926500 = 31415.000000)
Resources
  • Articles

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft