ugBASIC 1.18
An isomorphic BASIC language compiler for retrocomputers
Loading...
Searching...
No Matches
suite_6502_fp.c
Go to the documentation of this file.
1#include "../tester.h"
2
3int suite_fp_6502( Environment * _environment ) {
4
5 printf( "==== FLOATING POINT SUPPORT (MOS 6502) ====\n" );
6
7 printf( "--- ADD operation\n" );
8
9 for( int i=0; i<10; ++i ) {
10 for( int j=0; j<10; ++j ) {
11 double a = (float)(i) / 10.00;
12 double b = (float)(j) / 10.00;
13 test_fp_6502_add( _environment, a, b, a+b );
14 }
15 }
16
17 printf( "\n" );
18
19 printf( "--- SUB operation\n" );
20
21 for( int i=0; i<10; ++i ) {
22 for( int j=0; j<10; ++j ) {
23 double a = (float)(i) / 10.00;
24 double b = (float)(j) / 10.00;
25 test_fp_6502_sub( _environment, a, b, a-b );
26 }
27 }
28
29 printf( "\n" );
30
31}
int suite_fp_6502(Environment *_environment)
void test_fp_6502_add(Environment *_environment, double _first, double _second, double _expected)
void test_fp_6502_sub(Environment *_environment, double _first, double _second, double _expected)
struct _Environment Environment
Structure of compilation environment.