POV-Ray : Newsgroups : povray.general : abs()? Server Time
31 Oct 2024 08:15:52 EDT (-0400)
  abs()? (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: Tim Cook
Subject: abs()?
Date: 15 Nov 2005 17:41:02
Message: <437a63fe$1@news.povray.org>
From the documentation:

"abs(A) Absolute value of A. If A is negative, returns -A otherwise 
returns A."

er...that isn't what absolute value is.  absolute value of A is +A, if A 
is negative, the absolute value is +A, not -A.  is the behaviour of POV 
or the documentation incorrect?

-- 
Tim Cook
http://home.bellsouth.net/p/PWP-empyrean

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GFA dpu- s: a?-- C++(++++) U P? L E--- W++(+++)>$
N++ o? K- w(+) O? M-(--) V? PS+(+++) PE(--) Y(--)
PGP-(--) t* 5++>+++++ X+ R* tv+ b++(+++) DI
D++(---) G(++) e*>++ h+ !r--- !y--
------END GEEK CODE BLOCK------


Post a reply to this message

From: Daniel Hulme
Subject: Re: abs()?
Date: 15 Nov 2005 17:46:46
Message: <20051115224652.306da813@surreal>
> "abs(A) Absolute value of A. If A is negative, returns -A otherwise 
> returns A."
> 
> er...that isn't what absolute value is.  absolute value of A is +A, if
> A  is negative, the absolute value is +A, not -A.  is the behaviour of
> POV  or the documentation incorrect?
You understanding of unary plus is incorrect.
+A = A. (A < 0) implies (-A > 0).

-- 
There once was a teacher of great renown,      Gather your goods        
Whose words were like the tablets of stone,    and follow me            
Because it's easier to learn than unlearn,     Or you will surely die   
Because we've passed the point of no return.   Paul Simon, 'The Teacher'


Post a reply to this message

From: Tim Cook
Subject: Re: abs()?
Date: 15 Nov 2005 18:04:59
Message: <437a699b$1@news.povray.org>
Daniel Hulme wrote:
> You understanding of unary plus is incorrect.
> +A = A. (A < 0) implies (-A > 0).

er...huh?  *looks horribly confused*  wait.  that's true.
-(-1) == 1, which > 0.

-- 
Tim Cook
http://home.bellsouth.net/p/PWP-empyrean

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GFA dpu- s: a?-- C++(++++) U P? L E--- W++(+++)>$
N++ o? K- w(+) O? M-(--) V? PS+(+++) PE(--) Y(--)
PGP-(--) t* 5++>+++++ X+ R* tv+ b++(+++) DI
D++(---) G(++) e*>++ h+ !r--- !y--
------END GEEK CODE BLOCK------


Post a reply to this message

From: Larry Hudson
Subject: Re: abs()?
Date: 15 Nov 2005 20:38:46
Message: <437a8da6$1@news.povray.org>
Tim Cook wrote:
>  From the documentation:
> 
> "abs(A) Absolute value of A. If A is negative, returns -A otherwise 
> returns A."
> 
> er...that isn't what absolute value is.  absolute value of A is +A, if A 
> is negative, the absolute value is +A, not -A.  is the behaviour of POV 
> or the documentation incorrect?
> 

Sounds right to me...

If A is negative, -A is negating a negative number, making it positive. 
  Right?   ;-)

      -=- Larry -=-


Post a reply to this message

From: Anthony D  Baye
Subject: Re: abs()?
Date: 16 Nov 2005 00:34:24
Message: <437ac4e0$1@news.povray.org>
Tim Cook wrote:
>  From the documentation:
> 
> "abs(A) Absolute value of A. If A is negative, returns -A otherwise 
> returns A."
> 
> er...that isn't what absolute value is.  absolute value of A is +A, if A 
> is negative, the absolute value is +A, not -A.  is the behaviour of POV 
> or the documentation incorrect?
> 
The definition of absolute value is as follows:

|x| is the distance between a given number (x) and 0 on a number line.

Thus:
abs(x) returns the MAGNITUDE of x, such that |x|=|-x|.  This value is 
always positive.

ADB


Post a reply to this message

From: Tim Cook
Subject: Re: abs()?
Date: 16 Nov 2005 07:00:57
Message: <437b1f79$1@news.povray.org>
Anthony D. Baye wrote:
>> "abs(A) Absolute value of A. If A is negative, returns -A otherwise 
>> returns A."
> Thus:
> abs(x) returns the MAGNITUDE of x, such that |x|=|-x|.  This value is 
> always positive.

Ahhhh ok, I just stumbled on the minus sign in confusion, as if you're 
not paying close attention it looks redundant and as though it returns a 
negative number.  Isn't there a better way of wording the docs there?

-- 
Tim Cook
http://home.bellsouth.net/p/PWP-empyrean

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GFA dpu- s: a?-- C++(++++) U P? L E--- W++(+++)>$
N++ o? K- w(+) O? M-(--) V? PS+(+++) PE(--) Y(--)
PGP-(--) t* 5++>+++++ X+ R* tv+ b++(+++) DI
D++(---) G(++) e*>++ h+ !r--- !y--
------END GEEK CODE BLOCK------


Post a reply to this message

From: Chris B
Subject: Re: abs()?
Date: 16 Nov 2005 07:34:56
Message: <437b2770$1@news.povray.org>
"Tim Cook" <z99### [at] bellsouthnet> wrote
> Isn't there a better way of wording the docs there?
>
> -- 
> Tim Cook
>

If you can think of one you could propose it on 
povray.documentation.inbuilt.

Chris B.


Post a reply to this message

From: Tom Melly
Subject: Re: abs()?
Date: 16 Nov 2005 11:23:11
Message: <437b5cef$1@news.povray.org>
"Tim Cook" <z99### [at] bellsouthnet> wrote in message 
news:437b1f79$1@news.povray.org...
>
> Ahhhh ok, I just stumbled on the minus sign in confusion, as if you're not 
> paying close attention it looks redundant and as though it returns a 
> negative number.  Isn't there a better way of wording the docs there?
>

Dunno - but IMHO it is a basic, albeit slippery, principle.


Post a reply to this message

From: Warp
Subject: Re: abs()?
Date: 16 Nov 2005 14:17:11
Message: <437b85b7@news.povray.org>
Tim Cook <z99### [at] bellsouthnet> wrote:
> Isn't there a better way of wording the docs there?

  Mathematicians understand it perfectly. Programmers understand it
perfectly.

  How can you explain it to someone who is neither? You would have to
start from number theory principles...

  What is curious is that people get confused but they don't try to think
about it at all. How would you understand "if A is negative, returns -A"?

  If it said "if A is negative, returns A" then that would obviously mean
that it doesn't change it. If it, however, returns "-A" then it has to
change it somehow because "A" is not the same as "-A".

-- 
                                                          - Warp


Post a reply to this message

From: Tim Cook
Subject: Re: abs()?
Date: 16 Nov 2005 14:28:13
Message: <437b884d$1@news.povray.org>
Warp wrote:
>   What is curious is that people get confused but they don't try to think
> about it at all. How would you understand "if A is negative, returns -A"?

I see "if A is negative" and parse "-A", then the -A following that 
makes me think "-A, returns -A", instead of "if the number is negative, 
the sign is dropped".

-- 
Tim Cook
http://home.bellsouth.net/p/PWP-empyrean

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GFA dpu- s: a?-- C++(++++) U P? L E--- W++(+++)>$
N++ o? K- w(+) O? M-(--) V? PS+(+++) PE(--) Y(--)
PGP-(--) t* 5++>+++++ X+ R* tv+ b++(+++) DI
D++(---) G(++) e*>++ h+ !r--- !y--
------END GEEK CODE BLOCK------


Post a reply to this message

Goto Latest 10 Messages Next 5 Messages >>>

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