🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5249

Re: nonportable code or incorrect compilers?

#5249
From: Doug Gwyn
Date: Thu, 28 Jul 1988 19:58
21 lines
1141 bytes
In article <376@accelerator.eng.ohio-state.edu> rob@kaa.eng.ohio-state.edu (Rob Carriere) writes:
>However, the conversion rule says that a is to be
>converted to double; this seems to contradict the idea that a is to be
>computed *once*.

That's not the rule.

	a op= b

(where a and b are expressions) is equivalent to

	a = a op b

EXCEPT that the expression a is EVALUATED only once.
I.e. if evaluation of the expression a has side-effects,
they will occur only once.
Once the expression is evaluated, it is used in the context

	a = a op b

and other stuff happens at that point.
Technical Details
Message-ID: <8244@brl-smoke.ARPA>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!umd5!brl-adm!brl-smoke!gwyn
References: <133@daitc.ARPA> <430@uwovax.uwo.ca> <374@accelerator.eng.ohio-state.edu> <8228@brl-smoke.ARPA> <376@accelerator.eng.ohio-state.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!attcan!uunet!lll-winken!lll-tis!ames!umd5!brl-adm!brl-smoke!gwyn
From: gwyn@brl-smoke.ARPA (Doug Gwyn )
Newsgroups: comp.std.c
Subject: Re: nonportable code or incorrect compilers?
Message-ID: <8244@brl-smoke.ARPA>
Date: 28 Jul 88 19:58:38 GMT
References: <133@daitc.ARPA> <430@uwovax.uwo.ca> <374@accelerator.eng.ohio-state.edu> <8228@brl-smoke.ARPA> <376@accelerator.eng.ohio-state.edu>
Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>)
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 20