You are not logged in.

#1 2008-01-31 22:17:18

tesjo
Member
Registered: 2007-11-30
Posts: 164

What's this C++ function?

I thought I would see how gcc calculates a simple function like sqrt(). In the cmath header I find

sqrt(float __x)
  { return __builtin_sqrtf(__x); }

This 'builtin' function doesn't seem to be in another header that I can find. So can someone tell me how this works? Is it delegated to the cpu or is that a bad guess?

Please don't post a sqrt code, thats not what I'm looking for.

Offline

#2 2008-02-01 00:07:31

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: What's this C++ function?

I think that falls back to a compiler-builtin function.  It's probably written in assembly or something of that sort.

Offline

Board footer

Powered by FluxBB