using LabWindows/CVI 8.1.1
declaring an __int64 variable called value, performing 1*value works fine until you try that in a compound function call ( f(g( dummy, 1*value), 1*value) ), where it results in "value*value" being passed to the function called.
do you think this is normal ?
attached is a software to reproduce the problem. and here is the output:
taking 2 steps, the operation is fine:
round called with: conversion=42, interval=8
round returns : 40
add called with : conversion=40, delay=8
add returns : 48
separated: 48
the same in one step fails:
round called with: conversion=42, interval=64
round returns : 0
add called with : conversion=0, delay=8
add returns : 8
grouped: 8
but note that this works fine: (i used "value" instead of "1*value")
round called with: conversion=42, interval=8
round returns : 40
add called with : conversion=40, delay=8
add returns : 48
grouped: 48
can you find the pattern in the failling computation?
(note the value passed into the interval parameter)
value : 8
round called with: conversion=42, interval=64
round returns : 0
add called with : conversion=0, delay=8
add returns : 8
grouped: 8
value : 9
round called with: conversion=42, interval=81
round returns : 0
add called with : conversion=0, delay=9
add returns : 9
grouped: 9
value : 10
round called with: conversion=42, interval=100
round returns : 0
add called with : conversion=0, delay=10
add returns : 10
grouped: 10
you guys at NI have strange maths: 1*value = value*value...
but wait, isn't it the compiler shiting itself with the constant ?
let's try 2*value instead of 1*value...
value : 7
round called with: conversion=42, interval=14
round returns : 42
add called with : conversion=42, delay=7
add returns : 49
grouped: 49
aaaaaaaargh....