Debian Codegraph @

basic/qa/basic_coverage/test_mod_operator.bas

raw
1 '
2 ' This file is part of the LibreOffice project.
3 '
4 ' This Source Code Form is subject to the terms of the Mozilla Public
5 ' License, v. 2.0. If a copy of the MPL was not distributed with this
6 ' file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 '
8
9 Option Explicit
10
11 Function doUnitTest as String
12
13 doUnitTest = "FAIL"
14
15 Dim a As Double, b as Double
16 a = 16.4
17 b = 5.9
18
19 ' tdf#141201 - MOD operands are rounded to Integer values before the operation is performed
20 if (a MOD b <> 4) Then Exit Function
21 if (16.4 MOD 5.9 <> 4) Then Exit Function
22 if (15.9 MOD 6.4 <> 4) Then Exit Function
23 if (2147483647.4 MOD 4 <> 3) Then Exit Function
24
25 doUnitTest = "OK"
26
27 End Function