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 7440105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:48:04+00:00 2026-05-29T10:48:04+00:00

I am working with a function in a C library that takes a number

  • 0

I am working with a function in a C library that takes a number as a parameter. Currently that means I have two versions, one for double and one for int.

What versions of functions should I provide for numeric types?

It is common to see this in the standard libraries, but they are not consistent enough to use a guideline e.g. atof, atol and atoi is one set, and strtod, strtol, strtoul is a different set and abs, labs is a third. That’s three different sets, with different naming schemes all in the same header file.

Edit:

This is not for a single use, and I do not know what variants are needed.

Ideally it would support every single standard variant, so is it sufficient to write three in the style of the strto* functions and making the user promote types where needs be?

  • 1 1 Answer
  • 0 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-29T10:48:04+00:00Added an answer on May 29, 2026 at 10:48 am

    Do you have a need for more function variants?

    I suspect that given this question needs to be asked, you only have a requirement for a double and an int, your two functions. If you have a genuine need to support a double complex for instance, build a specialized function to handle that.

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

Sidebar

Related Questions

I was just working on a function that I needed to return two values,
Does anyone have a working class or function to create the hashed email that
i used to have a function defined like this (that is working fine under
I have a helper function in a class library that creates and serves a
I have been looking for an elegant way to write a function that takes
i have this code $(function() { $('#ans_vote a span').click(function(){alert('working');return false;});}); and this html <div
I'm working on a C library that reads tag information from music files. I've
Hi Everybody, I have a third party library that contains an error. When I
I'm working on a library that needs reflection, and needs Scala-specific information as opposed
I have a C# class library that contains methods that need to be used

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.