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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:58:46+00:00 2026-06-10T11:58:46+00:00

I was talking with my colleague and he said that in code it’s better

  • 0

I was talking with my colleague and he said that in code it’s better to multiply than divide, but he didn’t argue why it is better, so I decided to find out, so:

For example, which case is better:

var caseOne = x / 2;

or

var caseTwo = x * 0.5;

And how do each do performance-wise?

Thanks for all answers 🙂

  • 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-10T11:58:47+00:00Added an answer on June 10, 2026 at 11:58 am

    These kind of micro-optimizations are really not worth the readability cost. You should really write code that makes sense. Oftentimes the compiler makes optimizations anyway.

    Write code that will be easy to read, maintain, and explain in the future, so that you don’t have to work around your solution, or worse, introduce bugs.

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

Sidebar

Related Questions

I'm developing a Rails app, and I was just talking with my colleague that
My job mostly consists of engineering analysis, but I find myself distributing code more
Talking about javax.crypto.Cipher I was trying to encrypt data using Cipher.getInstance(RSA/None/NoPadding, BC) but I
Im talking about performing a deep recursion for around 5+ mins, something that you
I've just been talking with a colleague about Entity Framework change tracking. We eventually
Today, while talking with my colleague, something odd came out of his mind. A
Is the execution time (run-time) performance of code in a class that is loaded
I'm taking over some project of a colleague that is on holidays now. Other
I'm trying to help a colleague with some code in a client side extension.
I am a college student taking a intro to programming C#. That being said,

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.