• 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
RE: doubles not behaving
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: doubles not behaving


  • Subject: RE: doubles not behaving
  • From: "Matthew Jaffa" <email@hidden>
  • Date: Sat, 12 Jun 2004 23:01:09 -0600

Looks to me as you are logging it as %d and that would output it as an integer.

try %.2f for two decimal places, or %f for the actual real inputted value without cutting off it to 2 decimal places.

Thats what looks like the problem to me.

Matt


From: Kodex <email@hidden>
To: email@hidden
Subject: doubles not behaving
Date: Sat, 12 Jun 2004 21:38:27 -0700 (PDT)

Ok, maybe i am missing something here but why does
this not output the same thing as the input?

double num;

num = [serial doubleValue];

NSLog(@"Serial = %d", num);




__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Prev by Date: Re: doubles not behaving
  • Next by Date: Re: Yet more random number woes!
  • Previous by thread: Re: doubles not behaving
  • Next by thread: Re: doubles not behaving
  • Index(es):
    • Date
    • Thread