Re: Help calculating large modulus

From: Gordon (elf_ster_at_hotmail.com)
Date: 12/08/03


Date: 8 Dec 2003 11:32:32 -0800

Thank you all for your answers. I'm working on 8.3.2.

Kevin Kenny of these newsgroups also previously posted this great
solution(compatible with 8.3.2)

    set newmac 123456abcdef
    set top 0x[string range $newmac 0 5]
    set bottom 0x[string range $newmac 6 11]

    set x [expr {$top*pow(2.,24)+$bottom}]
    set y [expr {floor($x/999979.)}]
    set modulus [expr {int($x-999899.*$y)}]

Thanks again!

Gordon

elf_ster@hotmail.com (Gordon) wrote in message news:<4a2e9945.0312071332.1caf497d@posting.google.com>...
> I'm a newbiew trying to get the modulus of a 32-bit number.
>
> (0x123456abcdef)mod(999899)
>
> I expected to do: set mod [expr 0x123456abcdef%999899] but I receive
> "integer value too large to represent".
>
> Any help greatly appreciated! TIA.
>
> Gordon



Relevant Pages

  • Re: outlook express
    ... >> where does outlook store my address book? ... > accessing the Microsoft newsgroups through the MS Product Support ... > to get to the Internet Explorer groups, then click the plus sign next to ... > Gordon Burgess-Parker ...
    (microsoft.public.windowsxp.general)
  • Re: regarding command line arguments
    ... are the C standard and the English language. ... Gordon stated up front the definitions he was using above and beyond ... those guaranteed by the standard, and proceded to answer the OP's ... have an appropriate newsgroups line in your header for your mail to be seen, ...
    (comp.lang.c.moderated)
  • Re: regarding command line arguments
    ... The only guaranteed references here ... Gordon stated up front the definitions he was using above and beyond ... those guaranteed by the standard, and proceded to answer the OP's ... have an appropriate newsgroups line in your header for your mail to be seen, ...
    (comp.lang.c.moderated)
  • Re: raised borders.... - chilcotin_sm.jpg (0/1)
    ... Thanks so much for the advice, it was exactly what I needed and it ... Re the newsgroups, how do I know if it's binary or non-binary? ... Gordon ... >BTW, it's preferable that you not add attachments to non binary news groups. ...
    (comp.graphics.apps.photoshop)
  • Help calculating large modulus
    ... I'm a newbiew trying to get the modulus of a 32-bit number. ... set mod [expr 0x123456abcdef%999899] but I receive ... Gordon ...
    (comp.lang.tcl)