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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:56:36+00:00 2026-06-01T00:56:36+00:00

In objective-c I am trying to evaluate the following expression: _c = _f /

  • 0

In objective-c I am trying to evaluate the following expression: _c = _f / 5 * 8;
It tells me that an int and a NSNumber are invalid arguments to a binary expression.

Whats wrong? I am just getting started with objective-c and cocoa but am familiar with php and basic and kinda familiar with javascript.

  • 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-06-01T00:56:37+00:00Added an answer on June 1, 2026 at 12:56 am

    Objective-C has several different structures in place for you to use in calculations. From its C roots come the primitive numbers, ints, floats, doubles, etc, on which you can perform arithmetic operations directly (+, -, *, /, etc.). These are what you’re looking to use.

    On a higher lever, Objective-C also has NSNumber objects, which are simple wrappers for the primitive types listed above. They’re used throughout Objective-C where primitives need to be stored (often within other objects such as arrays and dictionaries that don’t take primitive values directly). Because NSNumbers are objects, you cannot perform direct arithmetic operations on them, you have to draw out their primitive values first (using intValue, for instance, to get an integer value, or doubleValue to get a double-precision floating point number). Because it’s unclear what the variables represent in your question, I’m not going to venture a guess as to what it is you’re trying to do (I don’t want to mislead you), but you can find out more about NSNumber in the NSNumber Class Reference.

    Finally, as Richard mentioned, there are NSDecimalNumbers. These are almost never used, since they’re either simply not needed (they’re designed to hold extremely high-precision numbers, far beyond the capacity of regular primitive values), or too complicated to use. They also have their own methods for performing arithmetic operations, and are generally irrelevant for everyday use. Again, if you’re interested, look more into the NSDecimalNumber Class Reference.

    For the most part, you’re looking to use primitive numbers to do your calculations. When you need to store them, you can often ‘box’ and ‘unbox’ (store and retrieve) from NSNumber objects.

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

Sidebar

Related Questions

I am using Objective-C and trying to create int values that are between 1-99
I just trying know how to implement in objective c an equation that gave
I am trying to create an objective c interface that encapsulates the functionality of
I am using Objective-C and I am trying to set an equation that is
I'm trying to implement in Objective-C a proxy for an object in the following
I'm trying to compile the following Objective-C program on Ubuntu Hardy, but for some
I'm trying to implement a very simple strategy class in Objective-C that allows for
I am trying to compare objects in Objective-C and was just wandering how, for
I'm trying to learn Objective C & Cocoa, but I just can't manage to
I'm learning Objective-C and trying to make a very simple command line calculator. 'S'

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.