Questions tagged [numbers]

71 questions
12
votes
9 answers

Why are unsigned numbers implemented?

I can't figure out why microprocessor systems implement unsigned numbers. I guess the cost is just double the number of conditional branches, since greater than, less than, .etc, need a different algorithm than signed, still are there any algorithms…
jtw
  • 145
10
votes
7 answers

Why are there so many numeric types (bit, int, float, double, long)?

I've learned PHP, Java, and C. Now I'm curious as to why there are so many types of numerical data types like bit, int, float, double, and long. Why not make only one type for numericals? Is there any benefit to this? Maybe if we use integers to…
GusDeCooL
  • 212
  • 1
  • 2
  • 7
5
votes
1 answer

how to stop denormals from messing up a real-time process (like an audio app or plug)

So there is an Intel page about what to do about denorms. (BTW, I know exactly what denormals are and am quite familiar with IEEE-754 floating point standard.) I have two questions: What are the names of the system calls (in Visual Studio) to turn…
4
votes
3 answers

When is a number a magic number?

Over the last couple of months I have been diving into coding standard IfSQ. As a part of this IfSQ standard, a rule is to not use Magic Numbers. While I don't have a problem with building this rule into checks as FxCop or StyleCop, I am confused as…
Matthijs
  • 167
3
votes
3 answers

In programming light, what is special about the number 1223?

Just came across this post on reddit, where someone was charged $1,223 for a "FREE STEAK SALAD". I was trying to figure out 'Why 1223?' thinking that this might be a programming error somewhere. But 1223 seems to be pretty much an ordinary number…
Lazer
  • 309
0
votes
4 answers

Why is it an issue that it takes 2 digits to represent the number 10 in decimal?

So we use hexadecimal which has the advantage of going up to 15 in single digits A-F, but why is it an issue that it takes 2 digits to represent the number 10 in decimal? I was reading up about hexadecimal and I came across these 2 lines: Base 16…
Crizly
  • 317
-5
votes
1 answer

Distributivity and Associativity for 32/64bit signed integers

I'm looking into 32/64bit signed integers and their algebraic properties. I am quite sure that the the three operators +, - and * fulfill the distributive and associative property (integer division does not because of the information loss) even…
Artemis
  • 99