Browse by Tags

Tagged Content List
  • Blog Post: What's the difference? Remainder vs Modulus

    Today, another episode of my ongoing series " What's the difference? " Today, what's the difference between a remainder and a modulus, and which, if either, does the % operator represent in C#? A powerful idea that you see come up in mathematics and computer programming over and over again is the...
  • Blog Post: Bit twiddling: What does warning CS0675 mean?

    From the sublime level of continuation passing style we go back to the mundane level of twiddling individual bits. int i = SomeBagOfBits(); ulong u = SomeOtherBagOfBits(); ulong result = u | i; // combine them together Whoops, that's an error. "Operator | cannot be applied to operands of type int and...
  • Blog Post: Why does char convert implicitly to ushort but not vice versa?

    Another good question from StackOverflow . Why is there an implicit conversion from char to ushort, but only an explicit conversion from ushort to char? Why did the designers of the language believe that these asymmetrical rules were sensible rules to add to the language? Well, first off, the obvious...
  • Blog Post: Integer Arithmetic in VBScript, Part Two

    Here's another recent question I've received on bit twiddling in VBScript: You discussed the issues with interpreting error results that come back interpreted as signed longs last year. Suppose we have a large unsigned long value, something like E18F4994. VBScript returns this value as -510703212. How...
  • Blog Post: Integer Arithmetic In VBScript, Part One

    I've received some questions recently on how integer arithmetic works in VBScript, so I thought I might spend a few entries talking about some low-level bit twiddling topics. Here's one of the mails I got this morning: There seems to be a limitation on the largest number that the VBScript "mod" operator...
Page 1 of 1 (5 items)