
C语言
文章平均质量分 94
muzibing1221
喜欢嵌入式,喜欢C
展开
-
【快乐数学】雷神III中平方根倒数程序分析
获取代码 代码在github上 git clone https://github.com/raspberrypi/quake3.git 代码目录 在这款游戏中有一个经典的计算平方根的倒数的代码 float Q_rsqrt( float number )//函数 求平方根的倒数 即: y=1x y=\frac{1}{\sqrt{x}} y=x1 前言 在游戏中 模拟物理现象,例如计算光反射之类的常会用到 例如:雷神III的里面代码 code/renderer/tr_shade_calc.c 计算反射原创 2021-06-06 17:12:04 · 477 阅读 · 1 评论 -
【C语言】简单片段输入多行
第一行输入数字:n表示 将输入n行句子 后续每行都输入句子 #include <stdlib.h> #include <stdio.h> #include <string.h> #define SLEN 128 int getStrings(char * str) { int num = 0; char c; do{ ...原创 2020-02-23 11:18:20 · 1951 阅读 · 0 评论