Welcome to Dream.In.Code
Become a C++ Expert!

Join 149,920 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,999 people online right now. Registration is fast and FREE... Join Now!




floating point emulation in visual c++ 6.0

 
Reply to this topicStart new topic

floating point emulation in visual c++ 6.0, How to link in floating point emulation using visual c++ 6.0

crupib
5 Jan, 2008 - 02:03 PM
Post #1

New D.I.C Head
*

Joined: 5 Jan, 2008
Posts: 2

I need to compile and link in floating point emulation.
My compiler is visual c++ 6.0.
I checked all of the compiler and link options in the IDE but could not find anything. The following code is compiled and it is run on a 386 embedded system. This 386 does not have a floating point processor on it, so my
sin function and circle function do not work.
Any help would be greatly appreciated.

bc
CODE

--------------------------------------------------------------------------------------
#include <gdisp.h> /* LCD prototypes */
#include <gsimintf.h>
#include <gkeycode.h>
#include <stdio.h>
#include <math.h>
#include "gcolorcv.h"
#define PIVALUE 3.141592


int main(void)
{
    float f;
    GXT x; GYT y;
    int i;

    ginit();
    gselvp(0);
    gsetcvp(9,0,17,8);
    gputs("\n");
    gputs("line 1\n");
    gputs("line 2\n");
    gputs("line 3\n");
    gcrectangle(0,0,ggetvpw()-1, ggetvph()-1,G_BLACK);    
    gcrectangle(2,2,ggetvpw()-3, ggetvph()-3,G_BLACK);
    
    gselvp(1);
    gsetcvp(0,0,8,8);
    gcrectangle(0,0,ggetvpw()-1, ggetvph()-1,G_BLACK);    
    gcrectangle(2,2,ggetvpw()-3, ggetvph()-3,G_BLACK);
    gmoveto(3,ggetvph()/2);
    glineto(ggetvpw(),ggetvph()/2);
    gmoveto(3,ggetvph()/2);
    for (x = 3; x < ggetvpw()-3; x++)
    {
        f = PIVALUE*2.0;
        f *=x;
        f /= ggetvpw();
        y = (ggetvph())/2-(GYT)(sin(f) * (ggetvph())/2);
        glineto(x,y);
    }
    gselvp(2);
    gsetcvp(0,9,8,20);
    gcrectangle(0,0,ggetvpw()-1, ggetvph()-1,G_BLACK);    
    gcrectangle(2,2,ggetvpw()-3, ggetvph()-3,G_BLACK);
    for (i = 1; i < 4; i++)
        gcircle(20,20, 5*i,0);
    gselvp(3);
    gsetcvp(10,10,17,20);    
    gputs("How you doing!!");
    return 0;
}


This post has been edited by crupib: 6 Jan, 2008 - 05:44 AM
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/8/09 02:46PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month