FreeType只支持定点数,不支持浮点数

简介: FreeType只支持定点数,不支持浮点数

之前对此一无所知(也不可能全部看,也不可能看了就明白)。这次提交代码的时候,为此讨论了几次。


Alexei Podtelezhnikov commented:


In general, this API would be acceptable as long as it follows basic FreeType requirement: No floating point is allowed. Despite all the perceived conveniences of floating point for the user, FreeType remains a low level library possibly used on architectures that do not have FPU. I do not know if that is still true today. Still, we cannot break this rule for this. Therefore, the slant has to be passed as a fixed-point 16.16 sine and simply inserted in the matrix. This API remains ALPHA, which is to say it is subject to user customization.


 意思就是说,FT允许CPU没有FPU(浮点单元)也能正常使用。


 于是了解了一下定点数。就是一个小数,占用4个字节(32bit),指定其中几位(比如18)为整数,剩余的为小数(32-18=14)。


 自然的,要专门的函数进行相关计算。

目录
相关文章
|
9月前
QT里面字符串转ieee754标准的float浮点数
QT里面字符串转ieee754标准的float浮点数
191 0
|
9月前
|
编译器 C语言
C语言中整数如何自动转换为浮点数
C语言中整数如何自动转换为浮点数
478 0
|
9月前
|
存储 C语言
C语言中如何选择合适的方式将整数转换为浮点数
C语言中如何选择合适的方式将整数转换为浮点数
1837 0
浮点类型
Julia 支持 Float16, Float32, 和 Float64 浮点类型,分别对应半、单、双精度,以及复数和有理数。数字可写作 1.0, 1., 0.5, .5, -1.23 或科学记数法如 1e10, 2.5e-4。E 表示指数。
|
9月前
|
Python
Python的整型在计算中的精度可以通过使用二进制或十进制表示来体现
【5月更文挑战第6天】Python整型支持十、二、八、十六进制表示,其中十进制默认,二进制(0b前缀)、八进制(0o前缀)、十六进制(0x前缀)。计算时以二进制精度处理,确保结果准确。例如:123的二进制是0b1111011,八进制是0o173,十六进制是0x7b。
60 0
|
C语言
【C语言】数据类型的大小(没有浮点)
【C语言】数据类型的大小(没有浮点)
84 0
|
Python
python中整型与浮点型的数值转换
python中整型与浮点型的数值转换
314 0
|
Go Python
Go-数字与布尔类型详解(整型、浮点型、科学计数法等)
Go-数字与布尔类型详解(整型、浮点型、科学计数法等)
328 0
Go-数字与布尔类型详解(整型、浮点型、科学计数法等)

热门文章

最新文章