Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Terminal theme tool – a workaround for lack of 24-bit color in Zsh?
- X-seq: zsh-workers 43828
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: <zsh-workers@xxxxxxx>
- Subject: Re: Terminal theme tool – a workaround for lack of 24-bit color in Zsh?
- Date: Thu, 15 Nov 2018 12:44:37 +0000
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181115124439euoutp012d63751b2fb21fb47b3cfcd3fb0a9c90~nTNYWkA9b1437314373euoutp01F
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1542285879; bh=88Tmh31WBmqTXFGaNiUugRWCCqUgiRq/09CwGgKPWcU=; h=Subject:From:To:Date:In-Reply-To:References:From; b=V/T6iO7xEw9qE9s1/q37IhQioU1yTlY9ROWWlqXjVIyOiSGwoUA8YFo7cvbSf0ZjY V+8WagZpSV59m8RDd7aW/yY44uofJD6rMvJGYVCmDKs2I6KqUXLcf6P5yu0NXNPc5h HkuIZaI4066ANQROYcbbKxVwzVZ893LCkrxDIa14=
- In-reply-to: <B2AC3BAB-4105-4C49-BE8C-55DA32F94DE7@kba.biglobe.ne.jp>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVCEmTTMRR0P3kx9ktpLDBYqJ+MRsE77UMLFjonEZAixfA@mail.gmail.com> <58111-1540942908.680582@SXAw.BXd_.-x5N> <CGME20181115123621epcas4p154967be4f87a5221c5012b4caa1cd732@epcas4p1.samsung.com> <B2AC3BAB-4105-4C49-BE8C-55DA32F94DE7@kba.biglobe.ne.jp>
On Thu, 2018-11-15 at 20:50 +0900, Jun T wrote:
> In nearcolor.c, function RGBtoLAB(), floating point data are saved in
> float (not double) variables; for example:
>
> >
> > + float R = (float)red / 255.0;
> (snip)
> >
> > + R = 100.0 * (R > 0.04045 ? powf((R + 0.055) / 1.055, 2.4) : R / 12.92);
> Is this to improve performance?
> If so, it would be better to explicitly use float literals, such as 255.0f.
> Otherwise, since 255.0 is double, all the calculations are done in double
> (after promoting all values to double), and the final result is truncated
> back to float.
>
> I believe there is virtually no performance difference (on most CPUs).
The majority of standardish Unixy systems I know about are designed to
assume most floating point calculations are going to be done as double
--- I see Linux supplies float and long double versions of library
functions as a supplement. But I doubt Oliver was thinking that much
about optimisation here --- terminal IO is slow enough I can't see how
it could be a big deal.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author