• ✨ ARCHIVE MODE ✨
    The forum has now been set to read-only mode, no new posts, resources, replies etc will not be possible.
    We recommend you join our Discord server to get real-time response: Discord Invite Link

[Indev 0.49.1] Math.isint does not work correctly.

J

jianmingyong

Guest
<Math.isint()> does not seem to work.

What I expected to happen:
<Math.isint(5.5)> => Return False.

What actually happened:
<Math.isint(5.5)> => Return True.

Steps to reproduce:
Code:
version=2
@Text.show(<Math.isint(5.5123)>)
:end
 

nilllzz

Original Developer
Administrator
P3D Developer
Actually, this is how it is supposed to work, and the functions are derived from their original use, math.int and math.sng.
Math.int tries to convert everything it gets to an integer, it does so as well with numbers that have decimals.
The functions math.isint and math.issng just return if those functions mentioned above return a positive conversion result.
 
J

jianmingyong

Guest
Actually, this is how it is supposed to work, and the functions are derived from their original use, math.int and math.sng.
Math.int tries to convert everything it gets to an integer, it does so as well with numbers that have decimals.
The functions math.isint and math.issng just return if those functions mentioned above return a positive conversion result.
But the <math.isint(3.123)> says it is a integer number... I though it isn't?
 
J

jianmingyong

Guest
hmm... Your script library says "Checks if the expression is an integer." so I though it work that way...
 
Top