Re: convert a decimal to 32 bit unsigned binary

From: Dave Allured - NOAA Affiliate <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Mon Feb 18 2013 - 14:01:05 MST

Xiaoyan,

Be careful. In the example you show, "36" is NOT a decimal number. It
looks like it is really a list of two separate integers, 3 and 6.

It is good that the example image showed the graphic mapping between
calendar days and bit positions, because the statement "Days of Month
Observed = 36" is badly constructed and very misleading. Maybe they should
have said "Days of Month Observed = 3 and 6".

So, what do you really want to do? Maybe convert a LIST of calendar day
numbers 1 to 31, to a 32-bit unsigned integer, using bit position encoding
as shown in this example?

Please reply only to the user list!

--Dave

On Mon, Feb 18, 2013 at 8:57 AM, cheryl Ma <xiaoyancloud@gmail.com> wrote:

> Dear all,
>
> Is there any function in NCL to convert a decimal number to a 32-bit
> unsigned binary? In an example shown below, 36 is a decimal, so its binary
> is 00100100000000000000000000000000.
>
> Thanks,
> Xiaoyan
>
> ==============================================
> [image: Figure 3: days of month flag interpretation.]
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Feb 18 14:01:19 2013

This archive was generated by hypermail 2.1.8 : Thu Feb 21 2013 - 11:26:43 MST