Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5996689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:08:20+00:00 2026-05-23T00:08:20+00:00

Just curious how are these implemented. I can’t see where I would start. Do

  • 0

Just curious how are these implemented. I can’t see where I would start. Do they work directly on the float‘s/double‘s bits?

Also where can I find the source code of functions from math.h? All I find are either headers with prototypes or files with functions that call other functions from somewhere else.

EDIT: Part of the message was lost after editing the title. What I meant in particular were the ceil() and floor() functions.

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:08:20+00:00Added an answer on May 23, 2026 at 12:08 am

    If you’re interested in seeing source code for algorithms for this kind of thing, then fdlibm – the “Freely Distributable libm“, originally from Sun, and the reference implementation for Java’s math libraries – might be a good place to start. (For casual browsing, it’s certainly a better place to start than GNU libc, where the pieces are scattered around various subdirectories – math/, sysdeps/ieee754/, etc.)

    fdlibm assumes that it’s working with an IEEE 754 format double, and if you look at the implementations – for example, the core of the implementation of log() – you’ll see that they use all sorts of clever tricks, often using a mixture of both standard double arithmetic, and knowledge of the bit representation of a double.

    (And if you’re interested in algorithms for supporting basic IEEE 754 floating point arithmetic, such as might be used for processors without hardware floating point support, take a look at John R. Hauser’s SoftFloat.)


    As for your edit: in general, ceil() and floor() might well be implemented in hardware; for example, on x86, GCC (with optimisations enabled) generates code using the frndint instruction with appropriate fiddling of the FPU control word to set the rounding mode. But fdlibm’s pure software implementations (s_ceil.c, s_floor.c) do work using the bit representation directly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just curious about which of these would be faster? $('ul.dropdown a').first().click(function(event) { event.stopPropagation(); return
Hey just curious is there a function that you can use to divide in
I am just curious. In IB, we can put a tableviewcontroller. However, as far
Just curious if there is anyway to display an objects retain count using NSLog.
I'm just curious if there's a reason why in order to represent -1 in
I am just curious if there is a way to swap the two stings
I am just curious is there any way to determine if a particular module
I'm just curious if there is any correlation between the length of the address
Fairly simple; I'm just curious if there's a better way to accomplish this. Given
I'm just curious (this is after HEAVY searching) if there are any classes for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.