Ir para o conteúdo
• Revista PROGRAMAR: Já está disponível a edição #57 da revista programar. Faz já o download aqui!

# Critical Excel 2007 bug cripples users

djthyrax    11

What is 850 x 77.1 ? a calculator will tell you it's 65535, but a critical flaw in Microsoft's Excel 2007 causes it return 100000 as the answer to this, and any other calculation for which the result is 65535.

Of interest is the fact that 65,535 is the largest number that can represented by an unsigned, 16 bit integer (i.e. 0xFFFF).

After a little experimentation in VBA, I have found that 100000 is only returned when accessing the cells "Text" property. When asking for the cells "Value" 65,535 is returned as expected.

I created a quick macro to test this after filling cell A1 with the formula "=850*77.1"

"and any other calculation for which the result is 65535"

I tested this myself. 850*77.1 indeed resulted in 10,000

but 85*771 resulted in 65535

Maybe it has something to do with one of the numbers including a decimal

From further in the discussion:

There appears to be more of them. For example:

=5.1*12850

=10.2*6425

=20.4*3212.5

=40.8*1606.25

=77.1*850

=154.2*425

=212.5*308.4

=308.4*212.5

=425*154.2

..etc

What's even stranger is this: Suppose the formula is in A1.

=A1+1 returns 100001, which appears to show the formula is in fact 100000

and a very Serious problem.

And if you multiply be say, 2 you get something else:

=A1*2

returns 131070, as if A1 had 65535. (which it should have been)

=A1*1

Keeps it at 100000.

=A1-1 returns 65534

=A1/1 is still 100000

=A1/2 retuns 32767.5

Using MAX() on a range appears not to see 100000.

Erro no handling de floats?

#### Partilhar esta mensagem

##### Partilhar noutros sites
pedrotuga    31

I cum carago... descobrem cada coisa... enfim... um pequeno bug.

Betovsky    2

#### Partilhar esta mensagem

##### Partilhar noutros sites
djthyrax    11
Gostei da leitura.

## Crie uma conta ou ligue-se para comentar

Só membros podem comentar

## Criar nova conta

Registe para ter uma conta na nossa comunidade. É fácil!

Registar nova conta

## Entra

Já tem conta? Inicie sessão aqui.

Entrar Agora

×