File: accuracy.hpc

package info (click to toggle)
hp48cc 1.3-7
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 380 kB
  • sloc: yacc: 452; ansic: 184; lex: 108; makefile: 90; sh: 90
file content (12 lines) | stat: -rw-r--r-- 340 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
// accuracy.hpc -- Test the HP48 accuracy -*- C -*-

// Calculate the number of significant bits in the mantissa
// of a floating number and the number of significant digits
// in a decimal number.

x = 2;
j = 0;
for (x = 2; x + 1 != x; x = x * 2)
	j = j + 1;
MSGBOX("Mantissa bits: " + j + "\nDecimal bits: " + 0.30103*j);
PURGE(@{x, j});