• 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
Does floorf work?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Does floorf work?


  • Subject: Does floorf work?
  • From: Scott Ellsworth <email@hidden>
  • Date: Mon, 26 Sep 2005 18:06:38 -0700

Hi, all.

I seem to be missing something here...

Why does

    float aReal = 39.89f;
    aReal = floorf(aReal);
    NSLog(@"Setting to %f",aReal);

    float expF = log10f(aReal);
    NSLog(@"exp %f",expF);
    float trimmedExpF = floorf(expF);
    NSLog(@"desired %f log %f trimmed %f",aReal, expF, trimmedExpF);

produce

2005-09-26 18:05:09.802 Astrogator[10479] Setting to 39.000000
2005-09-26 18:05:09.802 Astrogator[10479] exp 1.591065
2005-09-26 18:05:09.802 Astrogator[10479] desired 39.000000 log 1.591065 trimmed 1.591065


The trimmed value should have been 1.00000.

Scott
_______________________________________________
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: Does floorf work?
      • From: Scott Ellsworth <email@hidden>
  • Prev by Date: Re: QTKit for creating movies
  • Next by Date: Re: Does floorf work?
  • Previous by thread: Fixing menu of pop up button
  • Next by thread: Re: Does floorf work?
  • Index(es):
    • Date
    • Thread