当前位置:网站首页>Float. The specific meaning of the return value of floattorawintbits is to convert float into byte array
Float. The specific meaning of the return value of floattorawintbits is to convert float into byte array
2022-07-05 19:40:00 【It's hard not to write code all day】
Catalog
1 Code
int i = Float.floatToRawIntBits(9f);
2 explain
What is returned is the decimal number of the floating-point number of the value .
3 When to use this
We need to turn a two-dimensional array into a picture , Generally used byte transformation , That is to say, first put the float Use this for the value of Float.floatToRawIntBits(9f)
To int,
after
public static byte[] getBytes(int Float.floatToRawIntBits(x)) {
return new byte[] {
(byte) x, (byte) (x >>> 8), (byte) (x >>> 16),
(byte) (x >>> 24) };
}
such as Incoming x by 1.0f
Output is
[0, 0, -128, 63]
The above will realize float To byte Array
边栏推荐
- C#应用程序界面开发基础——窗体控制(6)——菜单栏、工具栏和状态栏控件
- 强化学习-学习笔记4 | Actor-Critic
- Reptile exercises (II)
- Add data to excel small and medium-sized cases through poi
- Is it safe for Anxin securities to open an account online?
- 如何在2022年更明智地应用智能合约?
- Mysql如何对json数据进行查询及修改
- 多分支结构
- Vagrant2.2.6 supports virtualbox6.1
- What does software testing do? What are the requirements for learning?
猜你喜欢
UWB ultra wideband positioning technology, real-time centimeter level high-precision positioning application, ultra wideband transmission technology
Recommended collection, my Tencent Android interview experience sharing
【obs】QString的UTF-8中文转换到blog打印 UTF-8 char*
5 years of experience, 27 days of Android programmer interview, 2022 programmer advanced classic
Do you know several assertion methods commonly used by JMeter?
使用 RepositoryProvider简化父子组件的传值
测试的核心价值到底是什么?
力扣 729. 我的日程安排表 I
webuploader文件上传 拖拽上传 进度监听 类型控制 上传结果监听控件
Xaas trap: all things serve (possible) is not what it really needs
随机推荐
Fundamentals of machine learning (III) -- KNN / naive Bayes / cross validation / grid search
详解SQL中Groupings Sets 语句的功能和底层实现逻辑
JAD installation, configuration and integration idea
40000 word Wenshuo operator new & operator delete
2022 the latest big company Android interview real problem analysis, Android development will be able to technology
Django uses mysqlclient service to connect and write to the database
IFD-x 微型红外成像仪(模块)关于温度测量和成像精度的关系
Using repositoryprovider to simplify the value passing of parent-child components
Hiengine: comparable to the local cloud native memory database engine
Common - Hero Minesweeper
Successful entry into Baidu, 35K monthly salary, 2022 Android development interview answer
The city chain technology Digital Innovation Strategy Summit was successfully held
id选择器和类选择器的区别
【FAQ】华为帐号服务报错 907135701的常见原因总结和解决方法
[OBS] qstring's UTF-8 Chinese conversion to blog printing UTF-8 char*
【硬核干货】数据分析哪家强?选Pandas还是选SQL
What are the reliable domestic low code development platforms?
Common interview questions in Android, 2022 golden nine silver ten Android factory interview questions hit
常用运算符与运算符优先级
Two pits exported using easyexcel template (map empty data columns are disordered and nested objects are not supported)