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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:00:31+00:00 2026-05-15T16:00:31+00:00

Rather than an 8.75 returned. Which method? Thanks.

  • 0

Rather than an “8.75” returned.

Which method? Thanks.

  • 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-15T16:00:31+00:00Added an answer on May 15, 2026 at 4:00 pm

    If I’m not completely wrong, 35/4 always evaluates to 8. Even in

    double result = 35 / 4;
    

    you will get this result (as double, i.e. 8.0). This is because 35 and 4 are both integers and therefore integer division is applied. The expression is first evaluated as integer and only the result is cast to a double value.

    On the other hand, if you want the correct result 8.75 you’ ll have to write

     double result = 35. / 4;
    

    in order to force floating point division to be applied. This is a common pitfall by the way.

    Of course, if you have double values, like in

    double a = 35;
    double b = 4;
    

    you need to either explicitely cast to an int or use Math.floor() as suggested in previous posts.

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

Sidebar

Ask A Question

Stats

  • Questions 541k
  • Answers 541k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The active view controller's shouldAutorotateToInterfaceOrientation: method determines whether the interface… May 17, 2026 at 2:48 am
  • Editorial Team
    Editorial Team added an answer There's two parts to this. Firstly you'll need to setup… May 17, 2026 at 2:48 am
  • Editorial Team
    Editorial Team added an answer I believe that you will find it in sSiteMetadata returned… May 17, 2026 at 2:48 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Thanks to some very helpful stackOverflow users at Bit twiddling: which bit is set?
I have some python code that: Takes a BLOB from a database which is
I've been following with great interest the converstaion here: Construct Query with Linq rather
I'm developing a Grails (Version 1.3.3) Web-Application using the Grails Spring-Security Plugin, Spring-Security-Core-1.0.1 (which,
I have working C++ code using swig which creates a struct, passes it to
I am in a situation where we need to modify what is being returned
I have a piece of template HTML that is returned from a Javascript function:
I'm unsure about when exactly I need to use the spread-dot operator. If I
In codeigniter, as you know, a page of the form: /class/function/ID , where class
I am declaring an array of NSString* in a header file of a class.

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.