LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

must divide take double?

Hi,

I need to use I16's extensively in one application. The problem that i have is that when i divide one by the other i always get coercion dots on the inputs to the divide (see the picture). I can understand the reason that the output is Double and i guess the inputs are double so that there is no conversion within the node. Is there any way round this apart from explicitly converting one to the other? Is there any addon's that can do integer division (e.g. I16 in and I16 out)? OpenG?

Thanks, Phil
0 Kudos
Message 1 of 6
(3,035 Views)
Hi,

You can use the "Quotient & Remainder" function from the numeric palette. This doesn't do a conversion. The result is not rounded but 'floored', i.e. 7 mod 2 results in 3, -7 mod 2 in -4 (next smaller number).

Daniel

0 Kudos
Message 2 of 6
(3,029 Views)
Use the quotient and remainder function on the numberic palette. You don't need to connect the Remainder connector.
0 Kudos
Message 3 of 6
(3,025 Views)
Thanks for the replies. Is this super-duper in terms of efficiency and speed?
0 Kudos
Message 4 of 6
(3,022 Views)
It is more efficient than using a divide function as the data doesn't need to be converted to a different format

0 Kudos
Message 5 of 6
(3,013 Views)
I usually use the Q&R function.
 
Of course you should be aware that if you use it as a division substitute, it always rounds the result down to the next lower interger, no matter how close the result is to the next integer above.
 
For many problems I am encountering, I need to round up to the next higher integer if there is a remainder and I usually use the following construct for simplicity:
 
 
 

Message Edited by altenbach on 11-01-2007 09:50 AM

Message 6 of 6
(2,986 Views)