Permalink
Browse files

Remove dependency on IEEE-Floats library, use float functions in nibb…

…les instead.
  • Loading branch information...
1 parent 2beeca2 commit e0b6ea1cee9815b0b3fdfa1f6d9c28bf9925bb0a @flambard committed Nov 15, 2012
Showing with 10 additions and 16 deletions.
  1. +1 −5 cleric.asd
  2. +9 −0 src/bops.lisp
  3. +0 −11 src/ieee-floats.lisp
View
@@ -9,7 +9,7 @@
:author "Markus Flambard <mflambard@common-lisp.net>"
:version "0.1.2"
:license "MIT License"
- :depends-on (:usocket :flexi-streams :md5 :ieee-floats :alexandria :nibbles)
+ :depends-on (:usocket :flexi-streams :md5 :alexandria :nibbles)
:components
((:module :src
:components
@@ -52,9 +52,6 @@
:depends-on ("packages"
"atom-cache"
"bops"))
- (:file "ieee-floats" ;; Needs IEEE-Floats library
- :depends-on ("packages"
- "bops"))
(:file "epmd"
:depends-on ("packages"
"listen"
@@ -116,7 +113,6 @@
:depends-on ("packages"
"constants"
"conditions"
- "ieee-floats"
"bops"))
(:file "erlang-fun"
:depends-on ("packages"
View
@@ -66,3 +66,12 @@
(let ((str (make-string n)))
(read-sequence str stream)
str))
+
+
+(defun double-float-to-bytes (f)
+ (let ((bytes (nibbles:make-octet-vector 8)))
+ (setf (nibbles:ieee-double-ref/be bytes 0) f)
+ bytes))
+
+(defun bytes-to-double-float (bytes)
+ (nibbles:ieee-double-ref/be bytes 0))
View
@@ -1,11 +0,0 @@
-;;;; Depends on the IEEE-Floats library
-
-(in-package :cleric-etf)
-
-(defun double-float-to-bytes (f)
- (let ((bits (ieee-floats:encode-float64 f)))
- (unsigned-integer-to-bytes bits 8)))
-
-(defun bytes-to-double-float (bytes)
- (let ((bits (bytes-to-unsigned-integer bytes 8)))
- (ieee-floats:decode-float64 bits)))

0 comments on commit e0b6ea1

Please sign in to comment.