[Home] [Groups] - Message: [Prev in Group] [Next in Group]

nu.kanga.list.mud-dev

7188: [MUD-Dev] Re: [CODE QUESTION] How to encode floats into bytes?

[Full Header] [Plain Text]
From: Ben Greear <greear@cyberhighway.net>
Newsgroups: nu.kanga.list.mud-dev
Date: Wed, 9 Sep 1998 18:28:56 -0700 (MST)
References: [1]
Organization: Kanga.Nu
On Wed, 9 Sep 1998, Adam J. Thornton wrote:

> On Wed, Sep 09, 1998 at 10:26:19AM -0700, J C Lawrence wrote:
> > > It would seem like there would be a method to do this somewhere!
> > Yup: roll your own or rely on everybody using IEEE floats (which in
> > the microcomputer (as versus mini or host) world is getting close to
> > universal).
> 
> Or decide that you don't really need blinding speed, figure out how much
> precision you need, and use sprintf()/sscanf().  This would be my tactic,
> because I'm lazy.

Highly tempting!  However, I expect bandwidth to be a bottleneck,
and will probably be dealing with a great deal of floating point data.
Once I get it working, I think it will be easy and fast to use..so it's
worth it to do the work now...

Of course, it aint done yet..so I may yet do the good ole sprintf :)


Thought about splitting it into two integers at the decimal too :)

Ben

> 
> Adam
> -- 
> adam@princeton.edu 
> "There's a border to somewhere waiting, and a tank full of time." - J. Steinman
> 
> -- 
> MUD-Dev: Advancing an unrealised future.
> 


Ben Greear (greear@cyberhighway.net)  http://www.primenet.com/~greear 
Author of ScryMUD:  mud.primenet.com 4444
http://www.primenet.com/~greear/ScryMUD/scry.html