Path: utzoo!attcan!uunet!mitel!sce!cognos!jimp From: jimp@cognos.uucp (Jim Patterson) Newsgroups: comp.lang.c Subject: Re: Is malloc() or calloc() "better"? Message-ID: <5003@aldebaran.UUCP> Date: 10 Jan 89 14:35:58 GMT References: <9254@smoke.BRL.MIL> <17067@onfcanim.UUCP> Reply-To: jimp@cognos.UUCP (Jim Patterson) Organization: Cognos Inc., Ottawa, Canada Lines: 21 In article <17067@onfcanim.UUCP> dave@onfcanim.UUCP (Dave Martindale) writes: > I've seen people who use >calloc to zero their allocated arrays or structures assume that >"all bits zero" is the proper value for floating-point zero - >definitely not true on all machines. I'm compiling a list of such machines, but it's still empty. Can you enlighten us as to what some of these machines are? Do they have C compilers? Is all-bits-zero actually invalid (i.e. will cause a trap of some sort), or is it just not the "preferred" representation of zero? (I suspect that many BCD floating-point implementations won't even bother to check in the interests of efficiency, and so will end up getting it right anyways). I also agree that zero-filled memory isn't (maximally) portable, but I still don't know what machines it's not portable to. -- Jim Patterson Cognos Incorporated UUCP:decvax!utzoo!dciem!nrcaer!cognos!jimp P.O. BOX 9707 PHONE:(613)738-1440 3755 Riverside Drive Ottawa, Ont K1G 3Z4