Atlas 0.7.0
Networking protocol for the Worldforge system.
atlas.codecs.binary2.Binary2Parser Class Reference

def encode_float(self, value): mant, exp = frexp(value) mant = long(mant *2L**20) exp = exp - 20 if mant>=0: if exp>=0: type_str = encode_pos_int(float_pos_pos_type) else: type_str = encode_pos_int(float_pos_neg_type) exp = -exp else: mant = -mant if exp>=0: type_str = encode_pos_int(float_neg_pos_type) else: type_str = encode_pos_int(float_neg_neg_type) exp = -exp return type_str + \ encode_pos_int(mant) + \ encode_pos_int(exp) More...

Inheritance diagram for atlas.codecs.binary2.Binary2Parser:
Collaboration diagram for atlas.codecs.binary2.Binary2Parser:

Detailed Description

def encode_float(self, value): mant, exp = frexp(value) mant = long(mant *2L**20) exp = exp - 20 if mant>=0: if exp>=0: type_str = encode_pos_int(float_pos_pos_type) else: type_str = encode_pos_int(float_pos_neg_type) exp = -exp else: mant = -mant if exp>=0: type_str = encode_pos_int(float_neg_pos_type) else: type_str = encode_pos_int(float_neg_neg_type) exp = -exp return type_str + \ encode_pos_int(mant) + \ encode_pos_int(exp)

Definition at line 74 of file binary2.py.


The documentation for this class was generated from the following file: