Re: precision problem or my error?
Re: precision problem or my error?
- Subject: Re: precision problem or my error?
- From: Ondra Cada <email@hidden>
- Date: Fri, 7 Apr 2006 22:13:00 +0200
Ivan,
On 7.4.2006, at 21:54, Ivan Kourtev wrote:
and all subsequent values of a[] are negative. I checked and 50 *
43287250 is indeed where the number crosses the 31-bit which would
result in a negative number if I were working with 2-byte short int's.
Ahem... a byte is eight bits, two-byte short is therefore 16 bits
(giving you range -32768 to 32767), and four-byte int is 32 bits
(with the range you are experiencing problems with, namely,
-2147483648 to 2147483647).
If you need eight-byte ints of 64 bits with range
-9223372036854775808 to 9223372036854775807, use long long (note that
long is in fact equivalent to int).
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden