Skip to content

Commit 52496e1

Browse files
authored
docs: Update cosine example to pass by value (#359)
This C library function, cos(), assumes pass by value, whereas XMLSERVICE defaults to pass-by-reference. If we don't specify "pass by value," we can get incorrect results, because we will be sending a pointer rather than a value. (Pass radian value 3.1459 to test.) Signed-off-by: Alan Seiden <[email protected]> Signed-off-by: Alan Seiden <[email protected]>
1 parent e40bf8c commit 52496e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/examples/cosine.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const conn = new Connection({
88

99
const program = new ProgramCall('QC2UTIL2', { lib: 'QSYS', func: 'cos' });
1010

11-
program.addParam({ type: '8f', value: '0' });
11+
program.addParam({ type: '8f', value: '0', by: 'val' });
1212
program.addReturn({ type: '8f', value: '' });
1313

1414
conn.add(program);

0 commit comments

Comments
 (0)