栈  0.1
数据结构_第3章
ch3_2.cc File Reference

将十进制非负实数以二进制打印 More...

#include "Stack.hh"
#include <cmath>
#include <iostream>
#include <string>
Include dependency graph for ch3_2.cc:

Go to the source code of this file.

Functions

static void prnUIntInBin (unsigned long decUi=0)
 将十进制非负整数以其二进制形式打印 More...
 
static void prnPDecInBin (double pDec=0.0, unsigned int errP=20)
 将(非负)十进制纯小数以其二进制形式打印 More...
 
int main (int argc, char const *argv[])
 将非负十进制实数以其二进制形式打印 More...
 

Detailed Description

将十进制非负实数以二进制打印

Author
Guorui Wei (31301.nosp@m.7602.nosp@m.@qq.c.nosp@m.om)
Version
0.1
Date
2020-04-05

Definition in file ch3_2.cc.

Function Documentation

◆ main()

int main ( int  argc,
char const *  argv[] 
)

将非负十进制实数以其二进制形式打印

Parameters
argc命令行参数的个数
argv命令行参数的值
Returns
int 程序正常终止时返回0

可选:命令行arg[1]为一个合法的非负十进制实数。若不给出,程序将要求用户输入。 合法表示: https://en.cppreference.com/w/cpp/language/floating_literal

Definition at line 43 of file ch3_2.cc.

References prnPDecInBin(), and prnUIntInBin().

Here is the call graph for this function:

◆ prnPDecInBin()

void prnPDecInBin ( double  pDec = 0.0,
unsigned int  errP = 20 
)
static

将(非负)十进制纯小数以其二进制形式打印

Parameters
pDec十进制纯小数
errP允许误差: 2^(-errP), 即输出小数点后errP位。默认取值20

Definition at line 94 of file ch3_2.cc.

Referenced by main().

Here is the caller graph for this function:

◆ prnUIntInBin()

void prnUIntInBin ( unsigned long  decUi = 0)
static

将十进制非负整数以其二进制形式打印

Parameters
decUi非负十进制整数

Definition at line 80 of file ch3_2.cc.

References Stack::linkStack< T >::push().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function: