# Questions tagged [numbers]

For questions relating to any data type that is numerical. This may include integers, rational numbers, floating-point, fixed-point, and large numbers.

10 questions
Filter by
Sorted by
Tagged with
5k views

### What are the drawbacks of allowing implicit boolean/integer conversions?

Some languages (C, C++, JavaScript, Python) allow one to use integers as booleans and vice versa: int x; if (x) // Equivalent to: x != 0 y(); Or: ...
• 7,891
176 views

### How are significant digits implemented?

When working with engineering data, it is often important to know the number of significant digits of numbers. However, decimal numbers in languages I've encountered so far don't seem to include this ...
• 199
530 views

### How could fixed-point be implemented?

Fixed point is essentially storing a number of units of a certain size instead of storing a significand and an exponent. However, if the units could be of any size, how big would the fixed-point units ...
• 7,891
2k views

### What are the pros and cons of fixed-point arithmetics vs floating-point arithmetics?

From Wikipedia: In computing, fixed-point is a method of representing fractional (non-integer) numbers by storing a fixed number of digits of their fractional part. ... More generally, the term may ...
• 990
407 views

### What are the disadvantages of this far-fetched idea: All integers can be treated as boolean arrays?

I do not know of any languages that support this idea but I just thought that since numbers are just bits, why should we not be able to access those bits directly? In most languages such as C or C++, ...
• 7,891
1k views

### What are some advantages/disadvantages of having built-in syntax to represent numbers in non-decimal bases?

(For this question, I'm referring to integers. This question also assumes the language still uses base two internally, even if to the programmer it appears as base ten - this question is about syntax)....
• 575
211 views

### Implementing a number to string semantics efficiently in a C-style language?

In C our options for converting numbers to strings and adding them to a string are limited to: Write your own function. sprintf() to a buffer. Either way, one ...
• 7,891
584 views

### What are the disadvantages of not handling big numbers?

What are the disadvantages of not being able to handle huge numbers also knows and an Integer limit like in JS? I know it's not a super common thing to run into problems like that while programming so ...
• 377
528 views

### What are the downsides of having types for floats and integers?

What are the downsides to having different data types for floats and integers instead of just a number data type? I know that having different ones can improve memory usage. But are there any ...
• 377