2009-06-21 12:55 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* source/rtl/binnumx.c
* contrib/xpp/binnumx.c
+ Added F2BIN() and BIN2F() Xbase++ functions.
Code is the same as FTOC() and CTOF() in hbct.
This commit is contained in:
@@ -17,6 +17,12 @@
|
||||
past entries belonging to author(s): Viktor Szakats.
|
||||
*/
|
||||
|
||||
2009-06-21 12:55 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* source/rtl/binnumx.c
|
||||
* contrib/xpp/binnumx.c
|
||||
+ Added F2BIN() and BIN2F() Xbase++ functions.
|
||||
Code is the same as FTOC() and CTOF() in hbct.
|
||||
|
||||
2009-06-21 12:48 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* contrib/hbxbp/xbp.ch
|
||||
+ Fixed non-debug branch to work in both normal code and codeblocks.
|
||||
|
||||
@@ -89,3 +89,24 @@ HB_FUNC( W2BIN )
|
||||
HB_PUT_LE_UINT16( szResult, uiValue );
|
||||
hb_retclen( szResult, 4 );
|
||||
}
|
||||
|
||||
HB_FUNC( F2BIN )
|
||||
{
|
||||
char buf[ sizeof( double ) ];
|
||||
double d = hb_parnd( 1 );
|
||||
|
||||
HB_PUT_LE_DOUBLE( buf, d );
|
||||
hb_retclen( buf, sizeof( buf ) );
|
||||
}
|
||||
|
||||
HB_FUNC( BIN2F )
|
||||
{
|
||||
if( hb_parclen( 1 ) >= sizeof( double ) )
|
||||
{
|
||||
const char * buf = hb_parc( 1 );
|
||||
|
||||
hb_retnd( HB_GET_LE_DOUBLE( buf ) );
|
||||
}
|
||||
else
|
||||
hb_retnd( 0.0 );
|
||||
}
|
||||
|
||||
@@ -94,4 +94,25 @@ HB_FUNC( W2BIN )
|
||||
hb_retclen( szResult, 4 );
|
||||
}
|
||||
|
||||
HB_FUNC( F2BIN )
|
||||
{
|
||||
char buf[ sizeof( double ) ];
|
||||
double d = hb_parnd( 1 );
|
||||
|
||||
HB_PUT_LE_DOUBLE( buf, d );
|
||||
hb_retclen( buf, sizeof( buf ) );
|
||||
}
|
||||
|
||||
HB_FUNC( BIN2F )
|
||||
{
|
||||
if( hb_parclen( 1 ) >= sizeof( double ) )
|
||||
{
|
||||
const char * buf = hb_parc( 1 );
|
||||
|
||||
hb_retnd( HB_GET_LE_DOUBLE( buf ) );
|
||||
}
|
||||
else
|
||||
hb_retnd( 0.0 );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user