Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #3274

Re: 64 bit, unsigned integer arithmetic in PostScript

Newsgroups comp.lang.postscript
Date 2018-07-05 11:25 -0700
References <0be87160-f08d-4edb-8442-fc6fa6508bf7@googlegroups.com>
Message-ID <16f150ff-11f5-49f2-b9a2-6d7fe88a5e44@googlegroups.com> (permalink)
Subject Re: 64 bit, unsigned integer arithmetic in PostScript
From luser droog <luser.droog@gmail.com>

Show all headers | View raw


On Wednesday, July 4, 2018 at 5:25:38 PM UTC-5, Terry Burton wrote:
> Hi,
> 
> I'm currently looking at what it would take to implement (for Barcode Writer in Pure PostScript) a somewhat "unique" barcode standard that is in the process of being drafted.
> 

Some thoughts. For a "C" portability perspective, it should be reasonable
to use ghostscript's 64-bit integer as long as you do an assert() to guard
the code that relies on this assumption.

Maybe something like this

{   mark
    (16#1122334455667788) token pop
    16#11223344 32 bitshift 16#55667788 add eq
} stopped {
    % rangecheck or other error
    cleartomark
    /64-bit-okay false def
}{
    % 64bit seems ok
    { /64-bit-okay true def } if
} ifelse


64-bit-okay not {
   CODE-REQUIRES-64-BIT-INTEGERTYPE  %poor-man's error message
}{
   % code that assumes 64 bit
   % ...
} ifelse

Implementing a more widely portable solution is a bigger -- but separate --
problem. 


For PRNGs my discovery has been that having the seed size the same as
the payload size makes the implementation very constrained. It'd be nice
if the seed could be an array of integers. This would affect 'srand' and
'rrand' but not 'rand' itself as far as interfaces.

This would make it substantially easier to write a PRNG with good 
characteristics.

Back to comp.lang.postscript | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

64 bit, unsigned integer arithmetic in PostScript Terry Burton <terry.burton@gmail.com> - 2018-07-04 15:25 -0700
  Re: 64 bit, unsigned integer arithmetic in PostScript luser droog <luser.droog@gmail.com> - 2018-07-05 11:25 -0700
  Re: 64 bit, unsigned integer arithmetic in PostScript John Reiser <vendor@BitWagon.com> - 2018-07-06 19:53 -0700
    Re: 64 bit, unsigned integer arithmetic in PostScript Terry Burton <terry.burton@gmail.com> - 2018-07-09 18:01 -0700
      Re: 64 bit, unsigned integer arithmetic in PostScript Terry Burton <terry.burton@gmail.com> - 2018-07-12 01:38 -0700
        Re: 64 bit, unsigned integer arithmetic in PostScript John Reiser <vendor@BitWagon.com> - 2018-07-14 16:54 -0700
          Re: 64 bit, unsigned integer arithmetic in PostScript Terry Burton <terry.burton@gmail.com> - 2018-07-14 17:40 -0700
            Re: 64 bit, unsigned integer arithmetic in PostScript Terry Burton <terry.burton@gmail.com> - 2018-07-16 16:03 -0700
              Re: 64 bit, unsigned integer arithmetic in PostScript John Reiser <vendor@BitWagon.com> - 2018-07-16 21:19 -0700

csiph-web