# Questions tagged [computer-arithmetic]

For questions about the particulars of doing math on computers, e.g. floating point numbers, over/underflow, implementing arithmetic operators/functions for binary numbers.

35 questions
Filter by
Sorted by
Tagged with
190 views

### Unexpected result when summing sorted (and unsorted) positive floating point numbers

I am exploring Higham's excellent Accuracy and Stability of Numerical Algorithms and chapter 4 is dedicated to summation. So I decided to test the most basic thing. Summing positive random numbers ...
• 71
77 views

### Dynamic tolerance in a conditional loop to obtain maximum precision allowed by machine floating point numbers

I have coded a simple program for a root finding problem using Halley's method. Here is the code: ...
146 views

• 1,281
2k views

### Is #define INT_MIN 0x80000000 okay?

In Computer Systems: a Programmer's Perspective: Writing TMin in C In Figure 2.19 and in Problem 2.21, we carefully wrote the value of TMin32 as -2,147,483,647-1. Why not simply write it as either -2,...
• 1,281
184 views

### How can I detect lost of precision due to rounding in both floating point addition and multiplication?

From Computer Systems: a Programmer's Perspective: With single-precision ﬂoating point the expression (3.14+1e10)-1e10 evaluates to 0.0: the value 3.14 is lost ...
• 1,281
132 views

### Division and Modulus for Large DIVISORS

Excel and also Excel VBA have no built-in support for arbitrary precision arithmetic. There are a few very large add-ins that can be installed to do these sorts of calculations where the operands are ...
51 views

### Problems with first and second complement

What I know 1=negative,0=positive Example 1. 27-13=14 Example 2. -39+92=53 For example 1. 27 to binary is 11011 13 to binary is 1101 So 1101 change to two complement will ...
1k views

### Best software to do big number calculations quickly

I am trying to do some work on some math conjecture. I am testing the conjecture numbers using very large math numbers (100+ digits ). I am currently using python to test these numbers. In the ...
• 143
173 views

### Evaluating $\log(\exp(x)+1)$ for negative $x$

With double precision, I get $\log(\exp(-3)+1)=0.048587351573741958$, which already has $4$ incorrect digits, and $\log(\exp(-30)+1)=9.348... \times10^{-14}$, which only has two correct digits. What ...
• 799
105 views

### Performing computations over the set of constructable numbers

The set of constructable numbers is commonly defined in one of two ways: the set of finite numbers reachable from the rational numbers through a finite sequence of addition/subtraction, ...
• 121
2k views

• 1,739
78 views

### How many years it would take our laptops to be as fast as the fastest super computer in 2000 [closed]

How many years it would take our laptops to be as fast as the fastest super computer in 2000 according to Moore's law?
• 103
161 views

### Fibonacci, variation on the theme

I am trying to calculate the numbers $n$ for which the $n$-th Fibonacci number $F_n$ is a multiple of $n$; that is fib(n)%n==0. Here is the best PARI code I could come up with (for the counting ...
4k views

### range of positive mantissa in given floating-point number representation

I am a student and I came to this question while solving problems regarding the float-points. ...
• 143
139 views

### How many bits to unambiguously represent fixed-point division?

Suppose I have a function which divides an $m$-bit unsigned integer $a$ by an $n$-bit unsigned integer $b$ and returns the quotient as a fixed-point number with $t$ fractional bits, truncating towards ...
• 173
125 views

### Integer arithmetic support on future HPC systems

I writing some robust geometric algorithms using quantization + integer arithmetic for evaluating exact predicates. However, since BlueGene's integer support is so terrible, it occurred to me that ...
• 3,959
2k views

### Need for quad precision in scientific computing?

Even if quad precision is not directly supported by most CPUs, many Compilers (GNU, Intel) support them. Also some software packages allow to compile with quad precision, e.g. PETSc. But is there ...
• 800
326 views

### Krylov subspace iterative methods in floating point arithmetic

Is there any work that considers Krylov subspace iterative methods in floating point arithmetic? I'm especially interested in how rounding errors influence the convergence and the accuracy of the ...
• 800
644 views

### In floating point arithmetic, why does numerical imprecision result from adding a small term to a difference of large terms?

I have been reading the book Computer Simulation of Liquids by Allen and Tildesley. Starting on page 71, the authors discuss the various algorithms that are used to integrate Newton's equations of ...
• 701
1k views

### Which is computed faster, $a^b$, $\log_a c$ or $\sqrt[b]{c}$?

Which is computed faster, $a^b$ or $\log_a c$ or $\sqrt[b]{c}$? $a$, $b$ and $c$ are positive reals with $b>1$. What kinds of algorithms will you use in the comparison? What are their complexities?...
• 1,281