File: rtest_decfp.mac

package info (click to toggle)
maxima-sage 5.45.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 113,788 kB
  • sloc: lisp: 440,833; fortran: 14,665; perl: 14,369; tcl: 10,997; sh: 4,475; makefile: 2,520; ansic: 447; python: 262; xml: 59; awk: 37; sed: 17
file content (23 lines) | stat: -rw-r--r-- 498 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 * Tests for decimal floats, basically copied from the decfp-core.lisp
 */

(kill(all),
 if not ?boundp('rounddecimalfloats) then load(decfp),
 sum:0
 );
0;

(for i: 1 thru 50 do sum:sum+decbfloat(9/10^i), is(sum < 1));
true;

is(sum+1/10^50=1.0L0);
true;

rationalize(1.0L-1)-1/10;
0;

/* The decfp code changes the value of bigfloatone (and possibly other 
such values) to decimal floats. Let's reset them. */
(reset(?bigfloat%pi,?bigfloat%e,?bfmhalf,?bfhalf,?bigfloatone,?bigfloatzero),0);
0$