help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Masking using Hexadecimal Values


From: Tatsuro MATSUOKA
Subject: Re: Masking using Hexadecimal Values
Date: Thu, 4 Aug 2016 15:01:30 +0900 (JST)

----- Original Message -----

> From: Maynard Wright 
> To: help-octave
> Cc: help
> Date: 2016/8/4, Thu 08:22
> Subject: Re: Masking using Hexadecimal Values
> 
> On Wednesday, August 03, 2016 01:16:16 PM Chip Wachob wrote:
>>  Hello,
>> 
>>  I'm new to Octave, but I am trying to do some work where I need to mask 
> off
>>  bits of a value.
>> 
>>  I've tried using bitand() but that only seems to return a binary value.
>>  The function seems to return either a 1 or 0 but what I am looking for is a
>>  function / command that will return the bit-wise and of two numbers.
>> 
>>  Eg:
>> 
>>  bitand (0x55AA, 0xF0F0) is currently producing a 0
>> 
>>  What command/function/code is required to have the statement yield 0x50A0?
>> 
>>  Thank you in advance for your time,
> 
> 
> bitand(0x55AA, 0xF0F0) returns 20640 (hex 50A0) on my Octave implementation.  
> I'm running Octave 3.8.1 under Kubuntu 14.04.
> 
> Maynard Wright
> 


I have tried octave 3.2, 3.4, 3.6, 3.8, 4.0, and dev. version of octave on 
windows.

For all version,
>> bitand (0x55AA, 0xF0F0)
ans =  20640
 (hex 50A0)


Perhaps something is wrong with your octave.
Please specify

1. Version number of octave
2. Platform  (e.g. Ubuntu 14.04)
3. The way to install octave

Tatsuro




reply via email to

[Prev in Thread] Current Thread [Next in Thread]