POV-Ray : Newsgroups : povray.off-topic : Programming langauges : Re: Programming langauges Server Time
5 Sep 2024 09:20:04 EDT (-0400)
  Re: Programming langauges  
From: Darren New
Date: 27 Oct 2009 12:11:27
Message: <4ae71baf$1@news.povray.org>
scott wrote:
> I don't know about you, but if I want to get a huge (>8bit) number from 
> the bytes, I would do this:

HugeInt mhi = 0;
for (b = length - 1; 0 <= b; b--)
   mhi = (mhi * 256) + arrayofbytes[b];


I was amused once when I posted something in the Ada forum where I wrote 
something like
    x = c0 * 256 + c1;
and they complimented me on having the "Ada mindset" because I didn't use a 
shift operator to build the integer. I said "I do that in C also. Every 
compiler can handle that these days."

-- 
   Darren New, San Diego CA, USA (PST)
   I ordered stamps from Zazzle that read "Place Stamp Here".


Post a reply to this message

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