Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: double free Date: Mon, 11 Jul 2016 11:02:10 -0700 Organization: None to speak of Lines: 22 Message-ID: References: <577ba42f.13700328@news.xs4all.nl> <48c43c3f-8e7e-0509-5b9d-04133e7bb537@verizon.net> <1b37ngjfpc.fsf@pfeifferfamily.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="945944de09706c9b4e29b53c9d2efdc2"; logging-data="15834"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19BcEw9YbcZjA1ad8y7i+Fj" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:b8DvFqXAoD68/XvnSTZmPO68nS8= sha1:OHKS6f+dXqEQYflsnM+kFZnVSnA= Xref: csiph.com comp.lang.c:90220 Malcolm McLean writes: [...] > When we change the precision, we also change the behaviour of code > when we approach the limits. In this case, hypothetically, the result > is a number scaled to be about unity, and the array contains terms of > descending magnitude which are summed to achieve the result. So if our > results are single precision floats, we can stop when the value goes > below FLT_EPSILON or thereabout, and we might know that will happen > within ten steps. > If we move to double, we've got to decide whether we need more > accuracy. Probably the reason for the change is that we do. So we'll > need more steps. > > But the change is a consequence of changing the type. And casting the result of malloc() is your solution? -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"