On Thu, Oct 6, 2011 at 7:56 AM, hsl4125 <qlhuang...@gmail.com> wrote:
> ActionScript 3.0 has no int64 type.
> How can use int64 in ActionScript 3.0??

I'm not sure about ActionScript, but I have worked with 64-bit values
in JavaScript protocol buffers so some of the following may be helpful
to you.

To the best of my knowledge, JS only has a single data type for
numbers (Number). The Number datatype in JS is a floating point value
that cannot represent the full range of 64-bit values without losing
precision.
http://stackoverflow.com/questions/5353388/javascript-parsing-int64

Therefore, the closure-library javascript version of protocol buffers
provides two different encodings for int64s (both String and Number).
http://code.google.com/p/closure-library/source/browse/trunk/closure/goog/proto2/test.pb.js#2644

The String version of these encodings can be combined with a JS "big
int" class to be able to operate on large values.
http://silentmatt.com/biginteger/
http://code.google.com/p/closure-library/source/browse/trunk/closure/goog/math/long.js

-Andy

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to