Re: I am experiencing a major math error
Re: I am experiencing a major math error
- Subject: Re: I am experiencing a major math error
- From: Paolo Costabel <email@hidden>
- Date: Mon, 15 Nov 2004 11:46:04 -0800
Your number is too big for an iint. The maximum value of a 32 bit int
is 2147483647 (4294967295 for an unsigned int).
Use a float instead.
April Gendill wrote:
Ok, I am trying to multiply one number by another an the answer is
like 700,000,000 off.
so I have
long number1 = 2295104;
long number2 = 2048;
long number 3 = number1 * number2;
NSLog gives me: 405405696
well that is totaly wrong. In the calculator the correct answer is:
4700372992
Why is the math in my program incorrect?
April.
_______________________________________________
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
--
Get Firefox! <http://www.getfirefox.com>
_______________________________________________
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