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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:08:11+00:00 2026-05-16T00:08:11+00:00

Is it possible to change the float *pointer type that is used in the

  • 0

Is it possible to change the

float *pointer

type that is used in the VS c++ project
to some other type, so that it will still behave as a floating type but with less range?
I know that the floating point values never exceed some fixed value in that project, so I want to optimize the program by memory it uses. It doesn’t need 4 bytes for each element of the ‘float *pointer’, 2 bytes will be enough I think. If I change a float to short and imitate the floating point behaviour, then it will use twice shorter memory. How to do it?

EDIT:

It calculates the probabilities. So there are divisions like
A / B
Where A < B,
And also B (and A) can be from 1 to 10 000.

  • 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-16T00:08:12+00:00Added an answer on May 16, 2026 at 12:08 am

    There is a standard 16-bit floating point format described in IEEE 754-2008 called “binary16”. It is specified as a format to store floating point values with reduced precisions. There is almost no compiler support for that yet (I think GCC supports it for certain ARM platforms), but it is quite easy to roll your own routines. This fellow:

    http://blog.fpmurphy.com/2008/12/half-precision-floating-point-format_14.html

    wrote a bit about it and also presents a routine to convert half-float <-> float.

    Also, here seems to be a half-float C++ wrapper class:

    half.h:
    http://www.koders.com/cpp/fidABD00D95DE84C73BF0218AC621E400E07AA77B53.aspx
    half.cpp
    http://www.koders.com/cpp/fidF0DD0510FAAED03817A956D251787609BEB5989E.aspx

    which supplies “HalfFloat” as a possible drop-in replacement type.

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

Sidebar

Related Questions

I'm not sure if this is actually possible, but can I change default type
Is it possible to change C#'s built-in Vector3 struct to not use floating point
Is it possible to change SQL in a z/OS mainframe COBOL application so that
Is it possible to use RSpec .should(change(...)).by(...) with float numbers and set the compare
I was wondering if it is possible to change the return type of a
When subclassing a base type, like float, is it possible to recalculate or reassign
Possible Duplicate: Which is the first integer that an IEEE 754 float is incapable
Possible Duplicate: Change the URL in the browser without loading the new page using
Possible Duplicate: Change icon on of an App in iOS 4 in run-time Is
Possible Duplicate: change layout and template in zend dynamically according to the device(android tab,iphone,ipad)

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.