www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/12/28/03:18:53

From: "Michael Schuster" <SCHUSTER AT merlin DOT e-technik DOT uni-erlangen DOT de>
Organization: LS f. Elektrische Energieversorgung
To: djgpp AT delorie DOT com
Date: Thu, 28 Dec 1995 09:03:29 MET
Subject: Re: New user needs help

Gruess Euch!

Someone wrote:

> Hi,    I have installed djgpp on my 486/sx. After 5 days I got "hello,
> world" to compile and run.  Then, on a roll, an integer Celsius to
> Fahrenheit program also worked.  I'm stuck again when I attempt floating
> point.  I did a 'set GO32=emu c:/djgpp/bin/emu387'.  Then another 'gcc' and
> another 'go32'. Program displays 'NaN' instead of either number.

Without having your program its not so easy, but as everyone makes 
the same mistakes I'd say you did a wrong 'printf'- call:
Look at the following program, compile it,- you willnot  get 
a error, but when running you will get a strange result depending on 
your machine:

/* printf("%d  is the wrong call*/
#include<stdio.h>
void main()
{ double z1; /* you can use float z1; if you like */
  z1=32.3;
  printf("%d",z1);
}

If you change printf("%d with printf("%f everything will be fine.

BTW: If I take a float -variable instead of double the program 
displays 32.299999. Why?

Happy new year

Michi 

P.S. I found SWORD in the DJGPP directory and installed it. Is there 
any English documentation, or why is it in French? What does SWORD? 
(Perhaps that's the reason why they've fired the atomic bomb this 
morning : To get simulation programm with a French documentation ...)'Bye, bye Mister Pride' (ABC, Night you murdered Love, Maxi)


----------------------------------------------------------------------
Dipl.-Ing                                       
Michael Schuster
Lehrstuhl fuer Elektrische Energieversorgung
Friedrich Alexander Universitaet Erlangen
Cauerstrasse 4
(0)9131 85 8761

----------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019