游戏开发论坛

 找回密码
 立即注册
搜索
查看: 2187|回复: 0

请问这些c++的define应该怎么用c#改写呢

[复制链接]

11

主题

53

帖子

53

积分

注册会员

Rank: 2

积分
53
发表于 2006-2-19 10:40:00 | 显示全部楼层 |阅读模式
//! returns the bitwise representation of a floating point number
#define FLY_FPBITS(fp)                (*(int *)&(fp))
//! returns the absolute value of a floating point number in bitwise form
#define FLY_FPABSBITS(fp)        (FLY_FPBITS(fp)&0x7FFFFFFF)
//! returns the signal bit of a floating point number
#define FLY_FPSIGNBIT(fp)        (FLY_FPBITS(fp)&0x80000000)
//! returns the absolute value of a floating point number
#define FLY_FPABS(fp)                (*((int *)&fp)=FLY_FPABSBITS(fp))
//! returns the value of 1.0f in bitwise form
#define FLY_FPONEBITS                0x3F800000

基本功能就是把float类型转换成2进制 这样就可以进行与或非操作了 但是我不知道同样的功能c#怎么实现呢?
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-23 11:48

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表