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

  • Home
  • SEARCH
  • 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 468585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:41:47+00:00 2026-05-12T23:41:47+00:00

After becoming more engaged with training new engineers as well as reading Jon Skeet’s

  • 0

After becoming more engaged with training new engineers as well as reading Jon Skeet’s DevDays presentation I have begun to recognize many engineers aren’t clear when to use which numeric datatypes when. I appreciate the role a formal computer science degree plays in helping with this, but I see a lot of new engineers showing uncertainty because they have never worked with large data sets, or financial software, or programming phyiscs or statistics problems, or complex datastore issues.

My experience is that people really grok concepts when they are explained within context. I am looking for good examples of real programming problems where certain data is best represented using data type. Try to stay away from the textbook examples if possible. I am tagging this with Java, but feel free to give examples in other languages and retag:

Integer, Long, Double, Float, BigInteger, etc…

  • 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-12T23:41:48+00:00Added an answer on May 12, 2026 at 11:41 pm

    I really don’t think you need examples or anything complex. This is simple:

    • Is it a whole number?
      • Can it be > 2^63? BigInteger
      • Can it be > 2^31? long
      • Otherwise int
    • Is it a decimal number?
      • Is an approximate value ok?
        • double
      • Does it need to be exact? (example: monetary amounts!)
        • BigDecimal

    (When I say “>”, I mean “greater in absolute value”, of course.)

    I’ve never used a byte or char to represent a number, and I’ve never used a short, period. That’s in 12 years of Java programming. Float? Meh. If you have a huge array and you are having memory problems, I guess.

    Note that BigDecimal is somewhat misnamed; your values do not have to be large at all to need it.

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

Sidebar

Related Questions

At work I have to connect to our server every day. After becoming annoyed
We have started using Spring framework in my project. After becoming acquainted with the
After some experience with functional languages, I'm starting to use recursion more in Java
After spliting a tab delimited file I have my required values in a string
After becoming fond with mustache.js template-style, I would like continue using it in node.js.
After reading some interesting posts here on SO, and many pages found on google,
I am just becoming familiar with encryption and the .NET framework. After looking at
After becoming somewhat estranged open source, and spending some years developing web applications in
It's becoming increasingly more and more difficult to find advice on how to use
I have a simple query which returns 25,026 rows: MySqlCommand cmd = new MySqlCommand(SELECT

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.