[pshaiCmd] Number Modulo Operation

0 155 Views 3 Comments 2 months ago
  • Simple but effective custom command for modulo operation.
    Made for the great users of VE, with love. <3

    ~pshai

    More on modulo operation: https://en.wikipedia.org/wiki/Modulo_operation

    • This topic was modified 1 month, 3 weeks ago by pshai.
    HaasScript Code
    DefineCommand('NumMod', 'Number Modulo operation')
    
    local num = DefineParameter(NumberType, 'number', 'Input number', true, 10, 'Number')
    local mod = DefineParameter(NumberType, 'modulo', 'Modulo', true, 4, 'Number')
    
    DefineOutput(NumberType, num % mod, 'Modulo of input number', 'Equals, NotEquals')
    • #1196
      Firetron
      Basic
      Up
      0
      Down

      This is in the latest standard lua math lib. Maybe someday our lua will be upgraded and we won’t need a CC for it?

    • #1207
      pshai
      Admin
      Up
      0
      Down

      This isnt needed in SE, but for VE there is no command block for it, so thats why it exists 🙂

      • This reply was modified 1 month, 1 week ago by pshai.
    • #1209
      Firetron
      Basic
      Up
      0
      Down

      Right, having it in the math lib for SE would be rather superfluous when you can just % in SE.

Login or Register to Comment

Unlock your crypto trading potential

Create a free account and enjoy everything we have to offer.

Join for Free