windows-nt/Source/XPSP1/NT/enduser/speech/tts/truetalk/backend/ftol.h
2020-09-26 16:20:57 +08:00

27 lines
650 B
C

/******************************************************************************
* FTOL.h *
*-------------*
*
*------------------------------------------------------------------------------
* Copyright (C) 2000 Microsoft Corporation Date: 12/04/00
* All Rights Reserved
*
********************************************************************* mplumpe ***/
#pragma once
// Do a floating to integer conversion quickly
// NOTE : FTOL rounds, while (int) truncates!!!
#ifdef _M_IX86
#define FTOL(f) fast_ftol(f)
__inline int fast_ftol (double f)
{
int i;
__asm FLD f
__asm FISTP i
return i;
}
#else
#define FTOL(f) (int) (f)
#endif