Skip to content

Commit

Permalink
Merge pull request #46 from dlai286/patch-1
Browse files Browse the repository at this point in the history
Added 32 and 64 bit float fields
  • Loading branch information
posborne committed Dec 19, 2016
2 parents 43a72bb + 29d02dd commit 6d30405
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ env:
- TOX_ENV=py34
- TOX_ENV=py35
- TOX_ENV=pypy
- TOX_ENV=pypy3
- TOX_ENV=coverage

# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
Expand Down
20 changes: 20 additions & 0 deletions suitcase/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,16 @@ class SBInt64(BaseStructField):
PACK_FORMAT = UNPACK_FORMAT = b">q"


class SBFloat32(BaseStructField):
"""Unsigned Big Endian 32-bit float field"""
PACK_FORMAT = UNPACK_FORMAT = b">f"


class SBFloat64(BaseStructField):
"""Unsigned Big Endian 64-bit float field"""
PACK_FORMAT = UNPACK_FORMAT = b">d"


# ==============================================================================
# Unsigned Little Endian
# ==============================================================================
Expand Down Expand Up @@ -1209,6 +1219,16 @@ class SLInt64(BaseStructField):
"""Signed Little Endian 64-bit integer field"""
PACK_FORMAT = UNPACK_FORMAT = b"<q"


class SLFloat32(BaseStructField):
"""Unsigned Little Endian 32-bit float field"""
PACK_FORMAT = UNPACK_FORMAT = b"<f"


class SLFloat64(BaseStructField):
"""Unsigned Little Endian 64-bit float field"""
PACK_FORMAT = UNPACK_FORMAT = b"<d"


# ==============================================================================
# BitField and Bits
Expand Down

0 comments on commit 6d30405

Please sign in to comment.