POV-Ray : Newsgroups : povray.unofficial.patches : Why & has higher precedence than + or - in isosurface functions? : Re: Why & has higher precedence than + or - in isosurface functions? Server Time
2 Sep 2024 06:15:55 EDT (-0400)
  Re: Why & has higher precedence than + or - in isosurface functions?  
From: Warp
Date: 7 Aug 2000 06:06:04
Message: <398e8a0c@news.povray.org>
Thorsten Froehlich <tho### [at] trfde> wrote:
: Sorry, but you are misunderstanding the concepts here:  You have to view the
: problem on a lower level than the C programming language.  You have to look
: at the hardware:  In case of a memory based CPU architecture, an access to a
: int casted to a char will have certain side effects that are usually
: "hidden" by a compiler, however, especially in the early days of C it was
: common to use the knowledge about the CPU the code would run on to increase
: speed.

  I think that a C compiler making this kind of thing (ie. when '1' is casted
to a char, the value '0' results) breaks the ANSI C standard, and thus the
compiler is not an ANSI C one.
  Of course you can use low-level tricks to, for example, get the endianess
of the system, but you can't do many of these tricks without breaking the
standard (usually the standard says about these things that they are undefined
and the compiler can do whatever it wants about them).
  But as you said, specially in embedded systems this kind of freedom makes
C a very versatile language. Not many other languages allow you to, for
example, write directly to a memory location some value.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.