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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:21:51+00:00 2026-05-14T22:21:51+00:00

I need to round a float value and convert it into an NSInteger value.

  • 0

I need to round a float value and convert it into an NSInteger value.

For example:

float f = 90.909088;

I want the result to be 91. How to get rid of this?

  • 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-14T22:21:51+00:00Added an answer on May 14, 2026 at 10:21 pm

    One of the following C math functions might work for you:

    • double ceil(double)
    • double floor(double)
    • double nearbyint(double)
    • double rint(double)
    • double round(double)
    • long int lrint(double)
    • long int lround(double)
    • long long int llrint(double)
    • long long int llround(double)
    • double trunc(double)

    To get more documentation, open a terminal session and type (for example)

    man lround
    

    I pick lround as an example because I think that is the one you want.

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

Sidebar

Related Questions

I'm using eclipse + Android SDK. I need to round a float value to
I need to round a result of a SQL round in a table array
I need to create a function which rounds decimal numbers like this: Round($32.95, 0)
I need to distribute a value based on some weights. For example, if my
I need to round a float to be displayed in a UI. e.g, to
I need a PHP function that will take a float and round it down
I have variable like float num = (x/y); I need to round up the
I have an interesting issue where I need to round the result of an
Sometimes I need to round a float to the nearest quarter and sometimes to
I need to round and print a price like below, but this does not

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.