• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
I am experiencing a major math error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

I am experiencing a major math error


  • Subject: I am experiencing a major math error
  • From: April Gendill <email@hidden>
  • Date: Mon, 15 Nov 2004 12:08:53 -0700

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


  • Follow-Ups:
    • Re: I am experiencing a major math error
      • From: Robert Tillyard <email@hidden>
    • Re: I am experiencing a major math error
      • From: Paolo Costabel <email@hidden>
    • Re: I am experiencing a major math error
      • From: Ricky Sharp <email@hidden>
    • Re: I am experiencing a major math error
      • From: Olivier Lanctôt <email@hidden>
  • Prev by Date: Custom NSTextView and scrolling problem
  • Next by Date: Re: Access instance var from NSValueTransformer
  • Previous by thread: Re: Custom NSTextView and scrolling problem
  • Next by thread: Re: I am experiencing a major math error
  • Index(es):
    • Date
    • Thread