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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:23:23+00:00 2026-06-15T06:23:23+00:00

I have a large float (primitive) array and not every element in the array

  • 0

I have a large float (primitive) array and not every element in the array is filled.
How can i mark a particular element as EMPTY.
I understand this can be achieved by some special symbols but still i would like to know the standard way.
Even if i am using some special symbol , how will i handle a situation where the actual data item is the value of special symbol.
In short my question is how to implement the NULL feature in a primitive type array in java.

PS – The reason why i am not using Float object is to achieve a high memory and speed performance.

Thanks
Vineeth

  • 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-15T06:23:25+00:00Added an answer on June 15, 2026 at 6:23 am

    Can you use Float.NaN?

    public class FloatArray {
        public static void main(String[] args) {
            float[] data = new float[10];
            data[5] = Float.NaN;
            for (float f : data){
                if (Float.isNaN(f)){
                    System.out.println("No Valve");
                } else {
                    System.out.println(f);
                }
            }
        }
    }
    

    Then where is not risk of using a Sentianl Value like -1 that may be valid and you can test using Float#isNaN(f)

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

Sidebar

Related Questions

Have three divs in a container that I want to float over a large
I have found large amounts of documentation on how to generate a 2D primitive
I have a large piece of code, part of whose body contains this piece
I have a structure (class) that keeps very large number of numbers (either float,
Say I have a large number (integer or float) like 12345 and I want
I have a float pointer array and I would like to convert it to
So I have a function that looks something like this: float function(){ float x
I have a large (in thousands) collection of word : value (float) pairs. I
I have a large append function in my code. In this append function, i
If I have a large binary file (say it has 100,000,000 floats), is there

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.