POV-Ray : Newsgroups : povray.off-topic : Teach yourself C++ in 21 days : Re: Days 1-5 Server Time
30 Jul 2024 00:29:30 EDT (-0400)
  Re: Days 1-5  
From: Invisible
Date: 20 Apr 2012 03:51:36
Message: <4f911588$1@news.povray.org>
>>> The integral part of the value is assigned to the int.
>> So... it always rounds towards zero?
>
> As long as they're both positive.

Does it round towards zero, or towards negative infinity?

>> Aren't expressions guaranteed to execute left-to-right?
>
> No. That's what the comma operator is for that you dislike so much. ;-)

Oh good. The book /insists/ that left-to-right order is guaranteed. Nice 
to know that in addition to being poorly explained, it's also factually 
inaccurate. :-P

>> always struggle to remember whether zero means true or false. The
>> solution,
>
> You're aware that boolean math matches up with + and * right? So
> remember it that way.

A better way might be to think of true and false as 1 and 0. (Although 
of course C allows true to be /anything/ that isn't 0, not just 1.)

>> From what I'm seeing, just having multiple compilation units is a
>> nightmare.
>
> Multiple compilation units is only a nightmare when each can't refer to
> any other compilation units.

I'm currently trying to work out how I can compile a program where 
module 1 refers to module 2, but module 2 also refers to module 1. As 
far as I can figure out, this is impossible...


Post a reply to this message

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