delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/11/30/05:31:23

From: kunst AT prl DOT philips DOT nl
Subject: Re: sqrt ?
To: bell AT rdt DOT monash DOT edu DOT au (Mr G Bell)
Date: Tue, 30 Nov 1993 11:09:22 +0100 (MET)
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu (DJGPP users list)

Gary Bell writes:

> 
> Hi All,  I have installed djgpp at home and it looks good.
> 
> I have just one question, has anyone had any problems with
> programs crashing when using sqrt.

Yes. There are two things to watch out for:

   (1) make sure to include the line '#include <math.h>' in your source
   (2) make sure the argument of sqrt() is non-negative ;-)

> 
> I am writing a mpeg encoder and the initialization of the DCT
> has a sqrt, when it is replaced with a number it works but
> with the sqrt the DCT crashes.
> 
> Does anyone have any suggestions,

I think you forgot to include <math.h>.
Otherwise, the argument is negative...

> 
> Thanks
> 
> Gary.
> 

 .^^^^^^^^           _____________________________________
 |      |          / Pieter Kunst (P.J.)                   \
 |  _  _|        /   Philips Research Laboratories,          \
.--(o)(o)      /     Building WY3, Prof. Holstlaan 4,         \
|@      _)   /       5656 AA  Eindhoven, The Netherlands.      |
  | ,___|   /        e-mail: kunst AT prl DOT philips DOT nl             /
  |   /     \_______________________________________________/
  /____\

- Raw text -


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