crypto icon indicating copy to clipboard operation
crypto copied to clipboard

The "mod" math remainder operator shall always return an integer

Open lvcabral opened this issue 6 years ago • 2 comments

Even if both numbers are float or double the result is an integer in Roku.

lvcabral avatar Dec 17 '19 17:12 lvcabral

Can you provide some test cases for this? I tried the following:

?type(3 mod 2&)
?type(7.5 mod 3)
?type(9& mod 2)

and get:

LongInteger
Float
LongInteger

strattonbrazil avatar Apr 13 '20 02:04 strattonbrazil

The issue is not the type returned but the actual value:

'In Roku
? 7.5 mod 3
 1
 'In BRS
? 7.5 mod 3
 1.5

lvcabral avatar Sep 13 '23 22:09 lvcabral