Skip to main content

Questions tagged [numbers]

6 votes
4 answers
741 views

In Postgres, it used to be quite common to use a 4-byte integer auto field for primary keys, until it started becomming somewhat common to run into the 2147483647 limit of 4-byte integers. Now, it's ...
orokusaki's user avatar
  • 1,093
7 votes
2 answers
2k views

My idea is that, if an unsigned 32-bit integer is used for representing angles in a way that 0 is 0°, 231 is 180° and 232−1 is just under 360°, all possible values are used and evenly distributed ...
matj1's user avatar
  • 187
0 votes
3 answers
644 views

I used Google search to convert numbers from one numeral system to another. 10 to binary is 0b1010; 10 to hexadecimal is 0xA. What's the meaning of 'b' and 'x', accordingly? I think these are ...
floreapaun's user avatar
0 votes
1 answer
133 views

In Kotlin or Java we have many different types: integer, byte, double, long, float, string, character, etc. But one can use an integer instead of byte, and a double instead of an integer. Why we need ...
user avatar
1 vote
2 answers
4k views

0xF, 0x0000000F (total width is 10 characters), and 0x0000000000000000F (total width is 18 characters) all mean 15 (decimal). Is it correct to say that there is no reason to add leading zeros to a ...
user90726's user avatar
  • 205
-1 votes
5 answers
3k views

Why are magic NUMBERS considered bad practice? For example: memcpy(ResourcesDir+GameDirLen, "/Resources", 11); What is wrong with the 11? Why are magical numbers so bad? Please, my question ...
user avatar
-1 votes
1 answer
215 views

This is part of a bigger problem, which is to find out if point XYZ exists in any of n (XYZ -> XYZ) "boxes". I'm currently splitting up the problem into a smaller one, by focusing on one dimension ...
Shadowjonathan's user avatar
13 votes
1 answer
1k views

Java 7+ allows to use underscores in numeric literals,which do not affect the value of the literal, yet are useful for grouping. Examples from the Java 7 documentation, entitled "Underscores in ...
David Tonhofer's user avatar
-4 votes
3 answers
931 views

According to Wikipedia: In mathematics and computing, hexadecimal (also base 16, or hex) is a positional system that represents numbers using a base of 16. Unlike the common way of representing ...
1.21 gigawatts's user avatar
-1 votes
3 answers
945 views

I am trying to understand the floating point system. Can the floating-point system represent all the real numbers within the range of (10^38) accurately? If so, then how is it possible? Because ...
Viper's user avatar
  • 39
30 votes
5 answers
8k views

This question is about how many bits are required to store a range. Or put another way, for a given number of bits, what is the maximum range that can be stored and how? Imagine we want to store a ...
rghome's user avatar
  • 688
-4 votes
4 answers
285 views

Why can't we directly convert octal number to base 8 to hexadecimal base 16 directly ? We can convert to octal by first converting it into binary equivalent, or by converting it to decimal equivalent ....
Zero001's user avatar
  • 19
2 votes
1 answer
144 views

This suggests just storing BigInts as an array: // n = -123 var n = { sign: -1, digits: [3, 2, 1] }; However, if you have "big ints", that array will get large: var n = { sign: -1, ...
Lance Pollard's user avatar
2 votes
3 answers
348 views

This will of course depend on the algorithm generating the pseudo random numbers, but what I'm wondering is whether practical, usable pseudo-random number generating algorithms exist that never repeat ...
Peter Berg's user avatar
2 votes
1 answer
593 views

I know that the rule in maths for modulus is this: ab mod n =(a mod n ) (b mod n) mod n I have found the following code for computing the modular exponentiation: pow(base,exponent,modulus){ if (...
user avatar

15 30 50 per page
1
2 3 4 5