How Do I Test Whether One Integer Is a Divisor of Another Integer?

Updated Oct 23, 2023

Reported In

Software

  • LabVIEW

Issue Details

I have an integer and would like to output a Boolean true every time it is divisible by a user adjustable number.

How do I test if one number can be divided by another with no remainder?

Solution

This can be achieved by using the Quotient & Remainder block. This block returns the remainder when one number is divided by another, if there is no remainder then the input number is divisible by user chosen number. By testing for a remainder of zero, the desired Boolean behaviour can be achieved.