• 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: What's up with sinf()?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's up with sinf()?


  • Subject: Re: What's up with sinf()?
  • From: email@hidden
  • Date: Wed, 21 Nov 2001 21:34:27 +0100

Le mardi 20 novembre 2001, ` 08:35 , email@hidden a icrit :

Something a bit wierd: I'm getting link errors when I try to use sinf()
instead of sin(). They're both defined in <math.h>, and presumably in
the same library, aren't they? I'd just as soon use sinf(), since what
I'm doing doesn't require double precision.

Are you using (Obj-)C or (Obj-)C++ ? There is no sinf() in C++, because sin() is overloaded to handle double and float (and complex,...).

What I'm doing BTW, is drawing gradients based on sinusoidal and
conic-section curves scaled to a 256x256 square. If someone could point
me to code for a fixed-point sin function, I'd just as soon use that.
I'd rather not embed a sine table in the code, though ;-)



You probably need the sin only for a few hundreds of value, then? It might be interesting to just pre-compute the values at startup, and then use the computed values many time.

Thomas Lachand-Robert
********************** email@hidden
<< Et le chemin est long du projet ` la chose. >> Molihre, Tartuffe.


  • Prev by Date: Re: Mutability
  • Next by Date: Re: Some questions about cocoa graphics2D
  • Previous by thread: What's up with sinf()?
  • Next by thread: Mutability
  • Index(es):
    • Date
    • Thread