Casio Z-1

Datasheet legend
Ab/c: Fractions calculation
AC: Alternating current
BaseN: Number base calculations
Card: Magnetic card storage
Cmem: Continuous memory
Cond: Conditional execution
Const: Scientific constants
Cplx: Complex number arithmetic
DC: Direct current
Eqlib: Equation library
Exp: Exponential/logarithmic functions
Fin: Financial functions
Grph: Graphing capability
Hyp: Hyperbolic functions
Ind: Indirect addressing
Intg: Numerical integration
Jump: Unconditional jump (GOTO)
Lbl: Program labels
LCD: Liquid Crystal Display
LED: Light-Emitting Diode
Li-ion: Lithium-ion rechargeable battery
Lreg: Linear regression (2-variable statistics)
mA: Milliamperes of current
Mtrx: Matrix support
NiCd: Nickel-Cadmium rechargeable battery
NiMH: Nickel-metal-hydrite rechargeable battery
Prnt: Printer
RTC: Real-time clock
Sdev: Standard deviation (1-variable statistics)
Solv: Equation solver
Subr: Subroutine call capability
Symb: Symbolic computing
Tape: Magnetic tape storage
Trig: Trigonometric functions
Units: Unit conversions
VAC: Volts AC
VDC: Volts DC
Years of production:   Display type: Graphical display  
New price:   Display color: Black  
    Display technology: Liquid crystal display 
Size: 3½"×8½"×1" Display size: 192×32 pixels
Weight: 14 oz    
    Entry method: Formula entry 
Batteries: 4×"AA" alkaline + 1×"CR-2032" Lithium Advanced functions: Trig Exp Grph Cmem Snd 
External power: Casio AD-4177   Memory functions: +/- 
I/O: Casio I/O, expansion port     
    Programming model: BASIC and C 
Precision: 13 digits Program functions: Jump Cond Subr Lbl Ind  
Memories: 18(0) kilobytes Program display: Text display  
Program memory: 18 kilobytes Program editing: Text editor  
Chipset: Intel 80C188   Forensic result: 9.000000103447  

*C programmable

z1.jpg (47895 bytes)Since I already had a PB-2000C calculator in my possession, it was easy to trace the origins of this Casio Z-1. Like its predecessor, the Z-1 is designed with the student programmer in mind, and contains, in addition to a BASIC interpreter, an implementation of the C-language.

The name of this machine is highly unusual, and doesn't fit with Casio's usual product nomenclature. Could it be that they named this handheld computer after Konrad Zus's Z-1, the first electromechanical (relay) computer built in 1935?

As with the PB-2000C, the Z-1's C implementation is robust. It runs flawlessly idiosyncratic programs like the one below computing π to an arbitrary number of digits. The main difference from the PB-2000C is that the Z-1 is much faster: this program takes several minutes to compute 50 digits of π on the PB-2000C, but on the Z-1, it takes only a few seconds.

long a=10000,b,c,d,e,*f,g;
main(){printf("digits?");scanf("%ld",&c);c*=3.5;c-=c%14;f=malloc(4*c+4);
for(;b-c;)f[b++]=a/5;for(;d=0,g=c*2;c-=14,printf("%.4d",e+d/a),e=d%a)
for(b=c;d+=f[b]*a,f[b]=d%--g,d/=g--,--b;d*=b);}

(This code is not of my own creation. I downloaded the original version ages ago from the Internet. I have no idea as to the identity of its original author.)

I have, of course, also written a Gamma function program for the Z-1. This is the same code I wrote for the PB-2000C. This beast computes the logarithm of the Gamma function for any real argument to 10+ digits of precision:

double lg(x)
double x;
{
	double g;
	double pi = 3.14159265359;
	int s;

	s = x<0;
	x = s ? -x : x;

	g = 2.506628283501;
	g += 92.20704845211 / x++;
	g -= 83.17763708288 / x++;
	g += 14.80283193078 / x++;
	g -= .2208497079533 / x;
	g = log(g) + (x-3.5)*log(x + .85) - x - .85;
	return s ? log(pi/(3-x)/sin(180*(x-3))) - g : g;
}

main()
{
	double g, x;
	printf("%lf", &x);
	g = lg(x);
	printf("lnG(%g)=%14.12g\n", x, g);
	printf("G(%g)=%14.12g", x, exp(g));
}