math operators

new topic     » topic index » view thread      » older message » newer message

PREFACE
I'm still not a C programmer, but operators appear to be
more logical to me.  Easier to use.  But that's just my
opinion.

POWER
I would love to see power(4, 5) become 4^5.
I know that we wouldn't be able to get read of power()
Shouldn't move it to an include either.  Since it is a
built-in. Of course, I would also like to see many others.

BITWISE OPERATORs
compare() become ==
and_bits() become &&
or_bits() become ||

or at least see them used as operators. Such as:
  if (int1 and_bits int2) then
    if (int2 or_bits int2) then
    end if
  end if
But that wouldn't be backwards compatible. :(
also there is modulo and integer divide

MODULO
I've always thought it odd that we didn't have a modulo
operator.  We have remainder().  Why not have (5 % 3)
or  (5 mod 3) or even (5 modulo 3)

INTEGER DIVIDE
We have floor(5/3).  Is 5\3 just too confusing?
I like % for modulo because it looks like a fancy divide.
Look at this.
5%3 -- remainder - modulo
5/3 -- divide
5\3 -- integer divide

They all are related and they all look similiar.

        if (you_have_a_computer_problem) then
            blame("Microsoft")
            reason("because everyone else does.")
        end if
        Lucius L. Hilley III - Unkmar

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu