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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:11:23+00:00 2026-05-12T09:11:23+00:00

Is it possible to get the raw bytes of a floating point (IEEE-754) Number

  • 0

Is it possible to get the raw bytes of a floating point (IEEE-754) Number object in Actionscript?

Or alternately, if I can get the sign (1 bit), mantissa (52 bits) and exponent (11 bits), then I can do the bitshifting myself and construct the raw byte array.

I’d like to create precise, compact string representations of Number values (hex, base-36, base-64, etc) for certain serialization situations.

I may also be interested in constructing compact 16-bit floats (IEEE half precision) and packing them into dense byte arrays.

For example, in Java, I might write code like this to create precise string representations of doubles:

public static String hexRepresentation(double value) {
   long bits = Double.doubleToLongBits(value);
   String hex = Long.toHexString(bits);
   return hex;
}

public static String b36Representation(double value) {
   long bits = Double.doubleToLongBits(value);
   String hex = Long.toString(bits, 36);
   return hex;
}

public static void main(String[] args) {
   System.out.println(hexRepresentation(123.456)); // 405edd2f1a9fbe77
   System.out.println(hexRepresentation(Math.PI)); // 400921fb54442d18

   System.out.println();

   System.out.println(b36Representation(123.456)); // z8nf9qi2e5pz
   System.out.println(b36Representation(Math.PI)); // z21th0e6pjiw
}

If anyone has any ideas for how to accomplish the same thing in actionscript, I’d love to know. But so far, it doesn’t seem possible. What about those new opcodes in the FP10 for Alchemy? Is there anything there that lets you get at the raw bytes somehow?

  • 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-12T09:11:23+00:00Added an answer on May 12, 2026 at 9:11 am

    I’m pretty sure you could do this just by creating a bytearray and then calling writeFloat on it. You could then read off each byte with readByte then shift and mask as needed to get exactly what you want.

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

Sidebar

Related Questions

Is it possible to get the raw HTTP Request from the HttpServletRequest object? I
HTTPWebResponse exposes properties for Headers, is it possible to get raw response like the
How, if possible, do I get the raw XML request/response that is invoked/retrieved by
Possible Duplicate: Converting Raw HTTP Request into HTTPWebRequest Object I've got a custom HTTP
Is it possible to get the raw audio being played by the other apps?
Possible Duplicate: Is there a way to get the raw SOAP request from within
Possible Duplicate: How to get raw href contents in JavaScript Sometimes you write in
does anyone know how to (if possible) get the owner of the tag on
I am trying to work out if it is possible get JPA to persist
Possible Duplicate: Get variable name. javascript “reflection” Is there a way to know the

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.