文件名 文件描述 浏览
◆ calculator.htm

it prompts the user to type a sum and then... calculates it

一个计算器

浏览
◆ A 5 Function Calculator.htm

Just a simple calculator that will add, subtract, multiply, divide, and it will also do powers like 5^3 = 125

可以作加,减,乘和除等的计算器

浏览
◆ A better Random Number Generator.htm

This is a better random number generator than comes standard. It's from a very good book on algoritms. You should read it

一个很好的随机数产生器

浏览
◆ A console Calculator.htm

It multiplies, divides, subtracts, and adds

一个控制台计算器

浏览
◆ A random number generator class.htm

A header file that contains a class for random number generation. The algorithm used here is from Andy Williams' submission, so I don't take credit for the random number generatior code, I just re-wrote it in a class for easier use and implementation

随机数产生器类

浏览
◆ A safer version of ltoa.htm

An improved, safer, ltoa() On call: num = number to convert string = buffer for output max_chars = maximum size of buffer base = number base for conversion. Return value: if illegal base NULL beginning of converted number. notes: if number is too large in magnitude to fit in the buffer, the MOST significant digits will be truncated. If the number is negative, a leading '-' will be placed in the buffer even if this causes the most significant digit to be truncated. The number is right justified in the buffer and the location of the first character in the number is returned so: If you want right justification, use the original string. If you want left justification, use the returned string. If the number doesn't fill the buffer: leading characters will be filled with spaces

一个关于ltoa()改进的更安全的版本

浏览
◆ A table of pionts for linear equations.htm

This code takes in a linear equations and prints ten ordered pairs for the graph of the equation

指向线性方程的表

浏览
◆ Add and display matricies.htm

Program to add and display two matrices. http://users.neca.com/jboxall/ja05003.htm

两个矩阵求和和显示的程序

浏览
◆ ADDTIME.htm

arguments: 1 - Base hours (0 -> 24) 2 - Base minutes (0 -> 59) 3 - Base seconds (0 -> 59) 4 - Span hours 5 - Span minutes 6 - Span seconds 7 - Address of returned hours (0 -> 23) 9 - Address of returned minutes (0 -> 59) 10 - Address of returned seconds (0 -> 59) 11 - Address of number of days to add to result returns: 0 if no error, non-zero if base time range error Notes: 1) Span values may be negative. 2) Overflowing midnight will cause a positive number of days to be returned. 3) Underflowing midnight will cause a negative number of days to be returned

增加一个时间日期到基准时间中

浏览
◆ Alphanumeric to Double (atod).htm

This is a function that will convert an alphanumeric string to a double... much like atoi and atof. This will teach you some math and some algo development. It takes a number in a string string and returns the value as a double. Supports maximum precision

转换含文字字符的字符串为双精度型的函数

浏览
◆ Using L_W Multiplication.htm

To calculate simple multiplication using C++

用C++来计算简单的乘法

浏览
◆ Area Program Using Radius.htm

This is the code needed to find the area of a circle

求圆的面积的代码

浏览
◆ Auto-convert hex or decimal strings.htm

Detect if a string denotes a hex or decimal number by detecting a leading "0X" or trailing "H" string

自动转换十进制或十六进制的代码

浏览
◆ Average.htm

works out the average of 4 numbers. At the moment it only allows you to input 4 numbers, but I will make an update to this program so that you can choose how many numbers you want to input. I made this program in under a minute so I will improve on this when I have the time

计算平均值的程序

浏览
◆ Base 64 encoder_decoder.htm

I built this project using Symantec C++ 7.0.4 on a Mac 9500. We needed a handle-based Base 64 encoder/decoder. Looked around the net, found a bunch of code that couldn't easily be adapted to in-memory stuff. Most of them work on files to conserve memory. This is inelegant in scripting environments such as Frontier. Anyway, so I wrote an encoder/decoder. Docs are being maintained on the web

基于64位的编译码器

浏览
◆ Baseball Average Calculator.htm

Calculates batting avarages for twenty players

计算20个球员的平均击球

浏览
◆ Basic 6 Function Calculator.htm

This is a simple calculator that demonstrates the use of switch, and more than one function. Is one of the first programs i've written, and helped me learn to use function prototypes

基于6的函数计算器

浏览
◆ Basic Calculator.htm

A basic calculator (+, -, *, /, ^). Using a pointer to a function and arrays. Good example to use pointers and functions

基本的计算器

浏览
◆ Batting Avg_ERA calculator.htm

Simple DOS calculator that calculates batting averages and earned run avg for baseball players

用于棒球运动员的简单DOS计算器

浏览
◆ BCDmath.htm

Routines to manage binary coded decimal. bcd_to_double() - Convert BCD to type double value. double_to_bcd() - Convert double type value to BCD

BCD码与双精度互换的函数

浏览
◆ Benchmark to test BITCNT_x.C functions.htm

Test program for bit counting functions

测试BITCNT_x.C的基准函数

浏览
◆ Big Num Part _1.htm

From Cliff Rhodes' package of unsigned integer math for arbitrarily large numbers

任意大数的无符号整数的封装

浏览
◆ Big Num Part #2_Divide BigNum_s.htm

From Cliff Rhodes' package of unsigned integer math for arbitrarily large numbers

任意大数的无符号整数的封装

浏览
◆ Big Num Part #3_ Test .htm

From Cliff Rhodes' package of unsigned integer math for arbitrarily large numbers

任意大数的无符号整数的封装

浏览
◆ Bit array functions.htm

Functions to maintain an arbitrary length array of bits

任意大小的位数组函数

浏览
◆ Body Mass Index.htm

This program will take in a person's height in inches and weight in pounds and returns the body mass index (BMI). BMI is defined as the weight, expressed in kilograms, divided by the square of the height expressed in meters

人的身高体重的索引

浏览
◆ CAL - a calendar for DOS.htm

Calendar using Ray Gardner's SCALDATE.C scalar date functions

DOS版本的日历

浏览
◆ CalculateCofactors.htm

This piece of code calculates the cofactors, the minors, and the value of the determinant of a 3x3 matrix with just one line of code each within a loop! Can't make it any shorter

计算3阶矩阵的阶数和秩的代码

浏览
◆ Calculate Cosine, Sine, and Tan.htm

Show Beginners how to use math.h header file to do sine, cosine, and tan

用math.h来计算cos,sin和tan函数

浏览
◆ Calculate fuel efficiency.htm

Program calculates the fule effiency of the car on the trip in miles/gallon and the cost for gasoline at the end of the trip. It teaches begginer programmers functions and calculations

计算汽车的燃油效率

浏览
◆ Calculate PI to ~1,000 digits.htm

Calculate PI to ~1,000 digits using integer math

用整数计算PI到~1,000数字

浏览
◆ CalculatePI.htm

This method implements the Salamin / Brent / Gauss Arithmetic- Geometric Mean pi formula. Let A[0] = 1, B[0] = 1/Sqrt(2) Then iterate from 1 to 'n'. A[n] = (A[n-1] + B[n-1])/2 B[n] = Sqrt(A[n-1]*B[n-1]) C[n]^2 = A[n]^2 - B[n]^2 (or) C[n] = (A[n-1]-B[n-1])/2 n PI[n] = 4A[n+1]^2 / (1-(Sum (2^(j+1))*C[j]^2)) j = 1 There is an actual error calculation, but it comes out to slightly more than double on each iteration. I think it results in about 17 million correct digits, instead of 16 million if it actually doubled. PI16 generates 178,000 digits. PI19 to over a million. PI22 is 10 million, and PI26 to 200 million. For what little it's worth, this program is placed into the public domain by its author, Carey Bloodworth, on September 21, 1996. The math routines in this program are not general purpose routines. They have been optimized and written for this specific use. The concepts are of course portable, but not the implementation. The program run time is about O(n^1.7). That's fairly good growth, compared to things such as the classic arctangents. But not as good as it should be, if I used a FFT based multiplication. Also, the 'O' is fairly large. In fact, I'd guess that this program could compute one million digits of pi in about the same time as my previously posted arctangent method, in spite of this one having less than n^2 growth. The program has not been cleaned up. It's written rather crudely and dirty. The RSqrt() in particular is rather dirty, having gone through numerous changes and attempts at speeding it up. But I'm not planning on doing any more with it. The growth isn't as low as I'd hoped, and until I find a faster multiplication, the method isn't any better than simpler arctangents. I currently use a base of 10,000 simply because it made debugging easier. A base of 65,536 and modifying the FastMul() to handle sizes that aren't powers of two would allow a bit better efficiency

计算PI

浏览
◆ Calculate PI to 8,000+ digits.htm

Computes Pi to an arbitrary number of digits Uses far arrays when/where required so may be compiled in any memory model The formula that most use (including the one in the Snippets) is the classic Machin formula, with the Gregory series. pi=16arctan(1/5)-4arctan(1/239) And use the traditional Gregory arctangent series to calculate the arctangents. That's the: arctan(x)=x-(x^3)/3+(x^5)/5-(x^7)/7..... With 1/5 and 1/239, it would be: arctan(x)=1/5-1/(3*5^3)+1/(5*5^5)-1/(7*5^7)... arctan(x)=1/239-1/(3*239^3)+1/(5*239^5)-1/(7*239^7).... Doing the multi-precision isn't too hard, since we don't really need to have a general purpose math package. We can hardwire it all. Due to the % operator, ms[i] < (temp * (239**2)) so temp < 3759 and i < 1879, it fails at the 1879th term which translates to 1879 * log10(239**2) == 8941th decimal. In practice we get a few more digits, (2 -> 8943th)

计算PI到任意的数字位

浏览
◆ Calculate the Quadratic Formula.htm

This code calculates the Quadratic Formula upon entering the A, B, and C variables. If the solution is real, it returns the answer(s). If it is imaginary, it returns the remaining formula (see screenshot)

计算二次方程

浏览
◆ calculates pressure ratio.htm

This program is designed to compute a value of pressure ratio (Pt/P0)

计算压力率的程序

浏览
◆ Calculates Quadratic Formula.htm

This code applies the quadratic formula to an equation and derives the variable value given the three coefficients

应用二次公式到方程的代码

浏览
◆ calculates the quadratic equation.htm

This program calculates the quadratic equation

求解二次方程的程序

浏览
◆ Chatting Calculator.htm

This is a chatting calculator which chats with you while calculating

能发音的计算器

浏览
◆ Circbuf.Hpp.htm

C++ templates for circular/ring buffers

圆或环的C++模板

浏览
◆ Circle Calculator.htm

Very simple code, figures out the area of a circle given its radius, demonstrates use of stdio.h

求圆面积的计算器

浏览
◆ compressible dynamic pressure.htm

solve for the value (Pt - P0)(known as compressible q) as a function of altitude and Mach number. Here is how your program should be structured

可伸缩的动态压力

浏览
◆ Compute combinations without overflow.htm

Compute C(n,m) = the number of combinations of n items, taken m at a time

计算函数Compute C(n,m)

浏览
◆ ComputeEuler_s.htm

Compute Euler's Totient function, phi(). phi(n) = the number of positive integers less than n which have no common factors with n

计算Euler's Totient函数

浏览
◆ Compute parity for any integraltype.htm

PARITY.C - Computes even or odd parity for various integral types

计算整数类型奇偶的函数

浏览
◆ Compute wind chill factor.htm

Wind Chill for exposed human skin, expressed as a function of wind speed in Miles per Hour and temperature in degrees Fahrenheit. Public domain from numerous published references

为暴露的皮肤计算寒战因子

浏览
◆ Convert Binary To Decimal.htm

This code helps C/C++ programmers convert binary(01000001) to decimal(65) using my function: int bin_to_dec(char binstr[ ])

转换二进制到十进制的代码

浏览
◆ Convert Celsius to Fahrenheit.htm

This is a easy example of randomly takeing 5 integers and placeing those values into Celsius and Fahrenheit . The program then converts the Celsius values to Fahrenheit and vise versa

实现摄式温度与华氏温度的互换

浏览
◆ Convertfloating.htm

Format floating point in engineering notation

对工程符号转换浮点数值

浏览
◆ Convert hex string.htm

Convert hex string to int

转换十六进制字符串为整型

浏览
◆ Convert long integers to roman numerals.htm

Converts long integers to Roman numerals

转换长整型为罗马数值

浏览
◆ Convert long to a string.htm

LTOA.C -- routine and example program to convert a long int to the specified numeric base, from 2 to 36. Written by Thad Smith III, Boulder, CO. USA 9/06/91 and contributed to the Public Domain. Parameters: 1 - number to be converted 2 - buffer in which to build the converted string 3 - number base to use for conversion (2-36) Returns: A character pointer to the converted string if successful, a NULL pointer if the number base specified is out of rang

e转换长整型为字符串

浏览
◆ Convert MPH to Feet Per Second.htm

This program allows you to convert miles per hour to feet per second

实现MPH与Feet Per Second的互换

浏览
◆ Convert MSBIN format to/from IEEE float.htm

MSBIN conversion routines

MSBIN与IEEE浮点数的互换

浏览
◆ Convert7-segment.htm

STR27SEG.C - Convert numeric strings to 7-segment strings

转换数值字符串为7段字符串

浏览
◆ Convert radians (=)degrees.htm

RAD2DEG.C - Functions to convert between radians and degrees

实现弧度与度数的互换

浏览
◆ Convertnumericstring.htm

BASCNVRT.C - Convert between number bases

在数字基数之间转换

浏览
◆ Convertrtol.htm

ROMAN2L.C Covert roman numerals to long integers

转换罗马数字到长整型

浏览
◆ ConvertSeconds.htm

To show how to convert Seconds into Hours Minutes and seconds. Ex. Seconds = 3668 Ans = Hour = 1 Minute = 1 seconds = 8

实现小时,分和秒的转换

浏览
◆ Count bits in a number.htm

Bit counter by Ratko Tomic

数的位计算器

浏览
◆ Countbitsinanumber.htm

BITCNT_4.C - Recursive bit counting functions using table lookup

递归位计算函数

浏览
◆ Decimal to Binary.htm

All this code does is convert decimal to binary. There are simplier was do do such but was asked to do this so just I put it together

转换十进制到二进制的代码

浏览
◆ DaylightSavingsTime.htm

ISDST.C - Determine is a date falls within Daylight Savings Time. The rule is that DST starts at 2:00 AM on the first Sunday of April and ends at 2:00 AM on the last Sunday of October

判断一个日期是否是白天的函数

浏览
◆ Determine permutation index.htm

Determine the permutation index for a given permutation list. Written by Thad Smith III, Boulder, CO 8/31/91 Hereby contributed to the Public Domain. The following function computes the ordinal of the given permutation, which is index of the permutation in sorting order: 1, 2, ..., n-1, n is index 0 1, 2, ..., n, n-1 is index 1 ... n, n-1, ..., 2, 1 is index n! -1 The actual values of the elements are immaterial, only the relative ordering of the values is used. pit[] is the array of elements of length size. The return value is the permutation index

确定一个给定排列的索引

浏览
◆ Determinethephase.htm

Returns 0 for new moon, 15 for full moon, 29 for the day before new, and so forth

确定给定日期的农历

浏览
◆ Dow.htm

This function is redundant with the function of the same name in DAYNUM.C. Which one to use? If you're already using any functions in SCALDATE.C, DAYNUM.C, or TODAY.C, ignore this file and use the other dow(). If you need a stand-alone DOW() function without using any of the rest of the SCALDATE package, use this file

计算日期对应的星期的函数

浏览
◆ EASTERDetermine.htm

Determine the date of Easter for any given year by Ed Bernal

确定给定年的复活节日

浏览
◆ easy-calculator.htm

Performs basic mathematical functions

基本的数学函数计算器

浏览
◆ Factor.htm

It takes a number as input and prints all its factors

输入数然后输出它的因子

浏览
◆ Factor Program.htm

This program factors numbers that are not bigger then a long number can handle

因式分解程序

浏览
◆ Factorial Calculation.htm

Prints the factorial of a number

输出一个数的阶乘

浏览
◆ FACTORYL.C.htm

Factorial, combinations, permutations

因式分解,合并和排列

浏览
◆ faren2celcius.htm

As an avid overclocker, keeping a cpu temperature monitored is one of the highest priorities. And since most others refer to temps in Celsius, us American folk use Farenheit, and I get so confused on both, so I just created a lil prog to convert for me, (and you) into a file that can be printed out easily from Notepad

监测CPU的温度

浏览
◆ Farenheit To Celcius Converter.htm

To Convert Farenheight to Celcius

转换华氏温度到摄式温度

浏览
◆ Fastlogarithmic.htm

Logarithmically scale from long integer to long integer. The ** function domain (input) & range (output) both start from 0 ** and the range MUST be smaller than the domain. ** ** This scaling function was especially designed to colour fractals. ** In order to preserve detail & to ensure that no colours are wasted, ** the function is almost linear with a slope near 1 for early values

快速的对数函数

浏览
◆ fdate.c.htm

Return DOS file date as a scalar value

返回DOS文件数据

浏览
◆ Financing Help.htm

This code allows you to enter the amount you have paid so far,how much intrest,and how many years and tells you how much you pay per month

金融理财的代码

浏览
◆ FindstheMinimum.htm

This program finds the Minimum number of 7 numbers entered

求出输入的7个数的最大数

浏览
◆ Formatdoubles.htm

Format a double using commas as thousands separators and a specified number of significant fractional digits

用逗号和变量精度来格式化双精度

浏览
◆ Format long integers using commas.htm

Notes: 1. Use static buffer to eliminate error checks on buffer overflow and reduce code size. 2. By making the numeric argument a long and prototyping it before use, passed numeric arguments will be implicitly cast to longs thereby avoiding int overflow. 3. Use the thousands grouping and thousands separator from the ANSI locale to make this more robust

用逗号来格式化长整型

浏览
◆ Format ordinal numbers.htm

Format ordinal numbers in English

用英文来格式化序数

浏览
◆ fourfunction calculator.htm

It teach user how to use switch statements to make a calculator

制作一个计算器

浏览
◆ Frogg Temperature Converter.htm

Convert temperatures from Fahrenheit, Kelvin, Celsius or Rankine scale

温度转换器

浏览
◆ General Tower of Hanoi.htm

We all know famous Hanoi Towers problem, and we all know how to slove the problem simplly using a recusive function. However, if the disk are randomly located, and the only rule is that no larger one on the top of smaller one, how the problem could be solved?

怎样有效的解决著名的Hanoi塔问题

浏览
◆ geometry.h.htm

Demonstrates basic encapsulation, class structure, and function overloading techinques. Also provides basic planar geometry functions

提供基本的平面几何函数

浏览
◆ gprime.c.htm

A simple yet very fast C-program (if not the fastest) I wrote to generate prime numbers and store them into 'primes.dat'. Also, you can restart the program at a later time and the prime numbers will automatically be added to the file

简单快速产生质数的C程序

浏览
◆ Greatest Common Divisor.htm This code calculates the GCD (greatest common divisor) with a recursive function given to me by a muchly appreciated code guru计算最大公约数的代码 浏览
◆ Greatest Common Factor.htm

The gcf() function takes in two integers and returns the greatest common factor

计算最大公因子的函数

浏览
◆ Hex library.htm

It converts decimal numbers to hex, and hex numbers into decimal. I know the hex to number function is abscent in the standard C/C++ library, so I made one for users to use

实现十进制与十六进制互换

浏览
◆ Highprecision.htm

High precision C++ floating point math library (requires library at: http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=211 ). Found at:http://www.rossi.com/sqr2.htm

高精度的C++浮点数学库

浏览
◆integermathlibrary.htm

High precision C++ integer math library. Found at: http://www.rossi.com/sqr2.htm

高精度的C++整数数学库

浏览
◆ Infix 2 Postfix.htm

It converts infix equation to postfix or reverse polish notation

插入2的后缀

浏览
◆ Infix to Postfix calculator.htm

This program uses two stacks, a char stack used to implement the operator stack and an int stack used to implement the operand stack, to evaluate simple infix expressions

用两个堆栈来求简单的后缀

浏览
◆ Integer division with rounding.htm

RND_DIV.C - Rounded integer division

四舍五入的整数除法

浏览
◆ Integer square root.htm

usqrt: ENTRY x: unsigned long EXIT returns floor(sqrt(x) * pow(2, BITSPERLONG/2)) Since the square root never uses more than half the bits of the input, we use the other half of the bits to contain extra bits of precision after the binary point. EXAMPLE suppose BITSPERLONG = 32 then usqrt(144) = 786432 = 12 * 65536 usqrt(32) = 370727 = 5.66 * 65536 NOTES (1) change BITSPERLONG to BITSPERLONG/2 if you do not want the answer scaled. Indeed, if you want n bits of precision after the binary point, use BITSPERLONG/2+n. The code assumes that BITSPERLONG is even. (2) This is really better off being written in assembly. The line marked below is really a "arithmetic shift left" on the double-long value with r in the upper half and x in the lower half. This operation is typically expressible in only one or two assembly instructions. (3) Unrolling this loop is probably not a bad idea. ALGORITHM The calculations are the base-two analogue of the square root algorithm we all learned in grammar school. Since we're in base 2, there is only one nontrivial trial multiplier. Notice that absolutely no multiplications or divisions are performed. This means it'll be fast on a wide range of processors

整数的平方根

浏览
◆ Integral Power.htm

Is a number an integral power of 2? This program calculates the answer

求2的整数幂

浏览
◆ Iterative Methods.htm

Iterative Methods of finding the roots of a function. The functions including: Secant,Regula-Falsi,Newton-Raphson,Halley Methods

求函数根的迭代法

浏览
◆ Leap Year Calculator.htm

A very fast code used for detecting leap years. You simply enter a year, and the program will tell you whether the year entered is/isn't a leap year

一个快速求闰年的代码

浏览
◆ Long double floor.htm

ldfloor() -- long double floor. Public domain by Raymond Gardner Englewood, CO, tested with TC++

用TC++来测试的ldfloor()函数

浏览
◆ Longinteger.htm

These routines convert Gregorian and Julian calendar dates to and from Julian Day Numbers. Julian Day Numbers (JDN) are used by astronomers as a date/time measure independent of calendars and convenient for computing the elapsed time between dates. The JDN for any date/time is the number of days (including fractional days) elapsed since noon, 1 Jan 4713 BC. Julian Day Numbers were originated by Joseph Scaliger in 1582 and named after his father Julius, not after Julius Caesar. They are not related to the Julian calendar. Based on formulae originally posted by Tom Van Flandern / Washington, DC / metares@well.sf.ca.us in the UseNet newsgroup sci.astro. Reposted 14 May 1991 in FidoNet C Echo conference by Paul Schlyter (Stockholm) Minor corrections, added JDN to julian, and recast into C by Raymond Gardner Englewood, Colorado

实现 Gregorian and Julian日历与JDN的互换

浏览
◆ longrand().htm

based on "Random Number Generators: Good Ones Are Hard to Find", S.K. Park and K.W. Miller, Communications of the ACM 31:10 (Oct 1988), and "Two Fast Implementations of the 'Minimal Standard' Random Number Generator", David G. Carta, Comm. ACM 33, 1 (Jan 1990), p. 87-88 linear congruential generator f(z) = 16807 z mod (2 ** 31 - 1) uses L. Schrage's method to avoid overflow problems

随机数产生器

浏览
◆ Mataix.htm

Simple code for a matrix object

用于矩阵对象的简单代码

浏览
◆ Math App.htm

To let all enjoy my work

数学App文件

浏览
◆ Math Application.htm

It can add, subtract, multiply, divide, find the circumference of a circle, find the angle of a triangle,and find the area of a quadrilateral

数学应用

浏览
◆ Matrix Inversion by Gauss - Jordan.htm

THE PROGRAM TAKES INPUT FROM A TEXT FILE. IT TAKES THE INVERSION OF THE MATRIX

求转置矩阵的程序

浏览
◆ Matrix Multiplication.htm

It takes a user inputed matrix and multiplys it by another user inputed matrix producing a matrix

求矩阵乘法

浏览
◆ Matrix rotate and reflect.htm

This code Rotates a Matrix 90, 180, 270 degrees and Reflects the rotated angle over a x-axis or y-axis

矩阵旋转和投影

浏览
◆ Matriz.htm

The code multiply Matrix A(m,n) B(n,p) , you enter with values column and rows

两个矩阵相乘的代码

浏览
◆ McGillSuper-Duper.htm

The McGill Super-Duper Random Number Generator G. Marsaglia, K. Ananthanarayana, N. Paul Incorporating the Ziggurat method of sampling from decreasing or symmetric unimodal density functions. G. Marsaglia, W.W. Tsang Rewritten into C by E. SchneiderMcGill Super-Duper

随机数产生器

浏览
◆ Metric.H.htm

English <-> Metric and other conversion macros

矩阵和其他的转换宏

浏览
◆ Minmax.H.htm

Macros & typesafe C++ templates for min() and max()

矩阵中求最大最小的C++模板

浏览
◆ NUMREC.htm

The code interprets digits entered through keyboard into simple English. It can interpret or translate upto 15 digits

翻译键盘输入的数字为简单的英文

浏览
◆ Odd Or Even.htm

You Input an Integer and the sode will decide weither its odd or even. Check it out its very simple and easy. If you enjoyed this example as much as ive had please vote for it :) http://thadood.ath.cx/~fatal

判断一个整数是基数或偶数

浏览
◆ Pi calculator.htm

This program is placed into the public domain by its author, Carey Bloodworth. This pi program can calculate pi with either integers, or doubles. It can also use a variety of formulas. This code isn't really optimized because it has to work with both the long integer version and the double version, and several formulas. Compromises had to be made in several places. When compiling, you can chose to use the FPU or the integer version. By default, it will chose to work only in integers. If you want to use the FPU, define: #define USEFPU 1 You have a choice of formulas. By default, it will use the Machin formula of: pi=16arctan(1/5)-4arctan(1/239) You could chose to use one of the other formulas. for pi=8arctan(1/3)+4arctan(1/7) #define ARC3 1 for pi=12arctan(1/4)+4arctan(1/20)+4arctan(1/1985) #define ARC4 1 for pi=16arctan(1/5)-4arctan(1/70)+4arctan(1/99) #define ARC5 1 for pi=32arctan(1/10)-4arctan(1/239)-16arctan(1/515) #define ARC10 1 Or, of course, you could define it on the compile command line with the -D switch. Timings were done on a Cyrix 486/66, with the slow Turbo C++ v3.0 1,000 2,000 3,000 4,000 1,000F 2,000F 3,000F 4,000F Machin 4 18 45 86 1 5 11 20 Arc3 6 29 74 140 2 9 20 35 Arc4 5 24 64 116 2 7 16 29 Arc5 6 26 65 123 1 6 15 26 Arc10 4 19 46 86 1 5 11 19 All of the combinations above were verified to their indicated precision and in each case, only the last few digits were wrong, which is a normal round off / truncation error. Better compilers will of course result in faster computations, but the ratios should be the same. When I used GCC 2.6.3 for DOS, I computed 4,000 digits with with the Machin formula and the FPU in 8 seconds. The integer version took 17 seconds. I also used the FPU GCC version to compute 65,536 digits of pi and verified them against the Gutenberg PIMIL10.htm, and only the last 4 digits were incorrect. The computations took 33 minutes and 54 seconds

圆周率PI的计算器

浏览
◆ Pi.H.htm

Useful definitions using

PI使用PI的定义

浏览
◆ Polynomials.htm

Polynomial class with overloaded +,-,* and = operators to enable performing those mathematical computations

重载+,-,*和=的Polynomial类

浏览
◆ Power.htm

Finds the power of a number. Pretty much beginners stuff

求一个数的幂

浏览
◆ power OF INTERGERS.htm

This program takes the power OF INTERGERS 1 TO 10 RAISED TO INTEGER POWERS. It shows user how to calculate power with math.h header file

求幂的math.h头文件

浏览
◆ Precise Calculation of Pi.htm

This code calculates an estimated value of Pi using the Leibnitz series (which is basically a power series expansion of a trigonometric function which allows to estimate Pi very well)

关于PI的精确计算代码

浏览
◆ prime factors.htm

This code takes a number (even a really long one) and finds the prime factors of it

求一个数的质数因子

浏览
◆ prime numbers.htm

find prime numbers

求质数

浏览
◆ Raise a number to an integer power.htm

IPOW.C - Raise a number to an integer power

求一个数的整数幂

浏览
◆ Random number generator.htm

This random number generator originally appeared in "Toward a Universal Random Number Generator" by George Marsaglia and Arif Zaman. Florida State University Report: FSU-SCRI-87-50 (1987) It was later modified by F. James and published in "A Review of Pseudo- random Number Generators" Converted from FORTRAN to C by Phil Linttell, James F. Hickling Management Consultants Ltd, Aug. 14, 1989. THIS IS THE BEST KNOWN RANDOM NUMBER GENERATOR AVAILABLE. (However, a newly discovered technique can yield a period of 10^600. But that is still in the development stage.) It passes ALL of the tests for random number generators and has a period of 2^144, is completely portable (gives bit identical results on all machines with at least 24-bit mantissas in the floating point representation). The algorithm is a combination of a Fibonacci sequence (with lags of 97 and 33, and operation "subtraction plus one, modulo one") and an "arithmetic sequence" (using subtraction). On a Vax 11/780, this random number generator can produce a number in 13 microseconds

随机数产生器

浏览
◆ rational number.htm

just for example rational number process and using overloded operator

重载运算符来产生有理数

浏览
◆ Read_write bit files.htm

BITFILES.C - reading/writing bit files

读/写bit文件

浏览
◆ Return any term in the Fibonacci series.htm

This program demonstrates how to calculate any arbitrary term of the Fibonacci sequence using phi (the golden number) and eighteenth century mathematician A. de Moivre's formula

计算Fibonacci数列的任意项

浏览
◆ Returnrandomdouble.htm

If n is negative it will randomize the seed, based on the current MSDOS time. If n is zero it will return the next random number. If n is positive it will set the seed to a value based on the value of n

求0.0和1.0之间随机的双精度数

浏览