LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
David_L

Quotient/Remainder function should have "mod" or "Modulo" as seach and quick drop tags.

Status: New

Most programming languages have a Mod or Modulo function which is equal to the remainder after a division.  LabVIEW has the Quotient and Remainder function in the palette which is equivalent, but most customers new to LabVIEW come in looking for a Mod function and cannot find it. LabVIEW should probably have this as an alternate function or at least put tags on the Quotient/Remainder function so that it comes up when users search for Mod or Modulo.

 

modulo.PNG 

7 Comments
Darin.K
Trusted Enthusiast

I would add to the documentation as well, otherwise some of these users may be a little confused as to why their code isn't working.  LV uses floored division, other languages use truncated division.  I often do the operation longhand just to remind myself what is going on. 

 

Ask yourself what is -7 % 3, then see what LV thinks it is.

 

If I were starting from scratch, I would implement the current method (floored) as the modulo function and have a separate function called remainder using truncated division.  That ship has long since sailed, and I think the best option is better documentation, along with the tagging idea.  I like the look of the proposed alternate function, but in general I am against redundancy.

muks
Proven Zealot
Kudos!!!
StevenM
NI Employee (retired)

Great thoughts, all.  I reported the documentation suggestions, and we'll consider improvements in a future release.

 

Thanks for your feedback,

 

-Steve M

LabVIEW Documentation

AristosQueue (NI)
NI Employee (retired)
Along with this, a whole lot of math operations should have alternate terms -- "plus" should find "add"... "minus" should find "subtract".
hecmar.arreola
Active Participant
When I first started using LabVIEW it took me a few minutes to find this function because I was so use to the Mod or Modulo terminology and expected it to be the same in LabVIEW.  Good suggestion!
shb
Active Participant
Active Participant
Darren
Proven Zealot

By default, Quick Drop uses a relevancy-based search, which will pick up keywords that have been assigned to built-in functions. The keywords "mod" and "modulo" are currently assigned to the Quotient & Remainder function. When using the relevancy-based search, however, Quick Drop is limited to displaying the top 100 results, and it appears that keyword matches are prioritized below object name matches. So if you have a ton of modules/toolkits installed, a Quick Drop search for 'mod' will probably not list the Quotient & Remainder function (it doesn't on my LabVIEW 2013 Platform DVD + Driver DVD install). It will work, however, with a search for 'modulo'.

 

All this to say, I'm wondering if it would be a good idea for us to prioritize keyword matches higher in the relevancy-based search results than name matches. This would put Quotient & Remainder at the top of a 'mod' search instead of the bottom.

 

FYI, the relevancy-based search mechanism in Quick Drop can be enabled/disabled with the "QuickDropFastSearch" INI token in LabVIEW 2009-2012. In LabVIEW 2013, it can be enabled/disabled by going to Quick Drop > Configure... > Options.