⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ratcalc.c

📁 miracl-大数运算库,大家使用有什么问题请多多提意见
💻 C
字号:
/*
 *      MIRACL RATIONAL CALCULATOR - IBM-PC VERSION
 *      Compiles with Turbo C V1.0+, Microsoft C V3.0+ or Zortech C++ V2.0
 *  **  Change display mode for 40/80 column operation (e.g. 'mode 40' to DOS)
 *  **  Change colour/B&W below
 *
 *   Copyright (c) 1988-1997 Shamus Software Ltd.
 */

#include <stdio.h>     /*** IBM-PC specific section ***/
#include <string.h>
#include <dos.h>        
#include "miracl.h"

#define ESC 27
#define SPACE 32
#define BELL 7

#define DVERT 186
#define DHORZ 205
#define DTLHC 201
#define DTRHC 187
#define DBLHC 200
#define DBRHC 188
#define VERT 179        
#define HORZ 196
#define TLHC 218
#define TRHC 191
#define BLHC 192
#define BRHC 217
#define LSIDE 199
#define RSIDE 182

/* Globals */
/* set colours          B/W       Colours (suggested) */

static int ORDINARY=0x17; /*   0x07        0x17    blue-white        */
static int INVER   =0x40; /*   0x70        0x40    red-black         */
static int BOLD    =0x70; /*   0x0F        0x70    white-black       */
static int BLINKING=0xF4; /*   0x87        0xF4    white-red (blink) */
static int HELPCOL =0x02; /*   0x07        0x02    black-green       */
static int PRESSED =0x4F; /*   0x0F        0x4F    red-white (bold)  */
static int STATCOL =0x74; /*   0x07        0x74    white-red         */
static int BGROUND =0x07; /*   0x07        0x07    black-white       */

static int dmode;

#if MIRACL==16
                /*** Constants 16-bit values ***/

static char cpi[] = "636254619847503442989626/202526135627569822173415";
static char clg2[]= "505741081295988878347013/729630149959545241557174";
static char clg10[]="979037493951642967431763/425190581199586827388880";

#else
                /*** Constants 32-bit values ***/

static char cpi[] = "67165660610256098973103849091/21379493784309731162770152371";
static char clg2[]= "16574595208316928044019202463/23912086311780807469140302041";
static char clg10[]="2379577069267877188193568690/1033437190446551110271192309";

#endif

static char ceps[]="1/100000000000000000000000000000000000";

                /*** Device independent data ***/

static char *settings[4][4]= 
{"   ","HYP","","",
 "Be ","B2 ","B10","",
 "RAD","DEG","GRA","",
 "DEC","HEX","OCT","BIN"};

static int nops[]= {1,2,1,3};         /* number of options   */
static int opp[] = {0,1,1,2,2,3,3,2}; /* operator precedence */

static char *keys[6][7]= 
{"SIN","COS","TAN","EXP","F-D","CLR","OFF",
 "ASN","ACS","ATN","LOG","SET","MOD","DEL",
 " 7 "," 8 "," 9 ","Y^X","X鸜"," 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -