|
@ -1,4 +1,4 @@ |
|
|
/* $OpenBSD: util.c,v 1.6 2004/07/07 07:32:05 alexander Exp $ */ |
|
|
|
|
|
|
|
|
/* $OpenBSD: util.c,v 1.7 2004/07/07 07:38:21 henning Exp $ */ |
|
|
|
|
|
|
|
|
/* |
|
|
/* |
|
|
* Copyright (c) 2004 Alexander Guy <alexander.guy@andern.org> |
|
|
* Copyright (c) 2004 Alexander Guy <alexander.guy@andern.org> |
|
@ -57,7 +57,7 @@ d_to_lfp(double d) |
|
|
{ |
|
|
{ |
|
|
struct l_fixedpt lfp; |
|
|
struct l_fixedpt lfp; |
|
|
|
|
|
|
|
|
lfp.int_part = htonl(d); |
|
|
|
|
|
|
|
|
lfp.int_part = htonl((u_int32_t)d); |
|
|
lfp.fraction = htonl((u_int32_t)((d - (u_int32_t)d) * UINT_MAX)); |
|
|
lfp.fraction = htonl((u_int32_t)((d - (u_int32_t)d) * UINT_MAX)); |
|
|
|
|
|
|
|
|
return (lfp); |
|
|
return (lfp); |
|
|