Removing decimal places from a 'float' without rounding - example

Help creating logic scripts for Air Manager Instruments

Moderators: russ, Ralph

Message
Author
JackZ
Posts: 2267
Joined: Mon Feb 22, 2016 1:02 pm

Re: Removing decimal places from a 'float' without rounding - example

#11 Post by JackZ »

Yes the math.modf() function is a lua standard built in function of the math library.

You get both the integer and the fractional part of any number, float or integer, and since it’s likely written in C it’s faster than any Lua code snippet

http://lua-users.org/wiki/MathLibraryTutorial
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

Post Reply