POV-Ray : Newsgroups : povray.general : bitwise operator on int ? Server Time
2 Nov 2024 03:13:10 EDT (-0400)
  bitwise operator on int ? (Message 1 to 4 of 4)  
From: Le Forgeron
Subject: bitwise operator on int ?
Date: 14 Jul 2010 01:03:48
Message: <4c3d4534$1@news.povray.org>
Greetings,

All these years of pov... and it seems I only fail now to find a bitwise
operator for integer.

Is there such things already as a bitwise-AND, bitwise-OR, bitwise-XOR
in the SDL ?

I currently would need a XOR, any suggestion ?


Post a reply to this message

From: Warp
Subject: Re: bitwise operator on int ?
Date: 14 Jul 2010 11:37:55
Message: <4c3dd9d3@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:
> Is there such things already as a bitwise-AND, bitwise-OR, bitwise-XOR
> in the SDL ?

  Since the SDL doesn't support integers (only floating point), bitwise
operators seem kind of pointless...

-- 
                                                          - Warp


Post a reply to this message

From: Le Forgeron
Subject: Re: bitwise operator on int ?
Date: 14 Jul 2010 14:22:44
Message: <4c3e0074@news.povray.org>
Le 14/07/2010 17:37, Warp nous fit lire :
> Le_Forgeron <jgr### [at] freefr> wrote:
>> Is there such things already as a bitwise-AND, bitwise-OR, bitwise-XOR
>> in the SDL ?
> 
>   Since the SDL doesn't support integers (only floating point), bitwise
> operators seem kind of pointless...
> 
Ok, so I guess you have no objection if I post a patch in p.u.patches
for that purpose on 3.7;

Bitwise operations are sometime useful (just like int()), even if the
result is afterall a floating number (the range with accuracy might be
reduced, but at least it should be fine unless the 52 bits of double
precision mantissa get in the way: for 16 bits, it should still be ok)


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: bitwise operator on int ?
Date: 14 Jul 2010 14:31:15
Message: <4c3e0273$1@news.povray.org>
On 14.07.10 20:22, Le_Forgeron wrote:
> Le 14/07/2010 17:37, Warp nous fit lire :
>> Le_Forgeron<jgr### [at] freefr>  wrote:
>>> Is there such things already as a bitwise-AND, bitwise-OR, bitwise-XOR
>>> in the SDL ?
>>
>>    Since the SDL doesn't support integers (only floating point), bitwise
>> operators seem kind of pointless...
>>
> Ok, so I guess you have no objection if I post a patch in p.u.patches
> for that purpose on 3.7;

Note that such a patch won't make it into 3.7 and likely won't be supported 
in any future version of an official POV-Ray with whatever syntax you use.

It may still be interesting to some though, so go ahead, I would say...

	Thorsten


Post a reply to this message

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