• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/tcl-105/tcl_ext/tcllib/tcllib/modules/math/

Lines Matching defs:atoms

92 # create a bignum of <atoms> atoms. For default zero is
95 # The function is designed so that "set b [zero [atoms $a]]" will
96 # produce 'b' with the same number of atoms as 'a'.
111 # Get the number of atoms in the bignum
112 proc ::math::bignum::atoms bignum {
117 # If the bignum is shorter than i atoms, the function
120 if {[::math::bignum::atoms $bignum] < [expr {$i+1}]} {
128 # has less than 'i+1' atoms, add zero atoms to reach i.
131 while {[::math::bignum::atoms $bignum] < [expr {$i+1}]} {
143 # Remove trailing atoms with a value of zero
147 set atoms [expr {[llength $bignum]-2}]
148 set i [expr {$atoms+1}]
149 while {$atoms && [lindex $bignum $i] == 0} {
151 incr atoms -1
154 if {!$atoms} {
249 set atoms [::math::bignum::atoms $a]
250 set r [::math::bignum::zero $atoms]
253 incr atoms 2
254 for {set i 2} {$i < $atoms} {incr i} {
404 # Left shift 'z' of 'n' atoms. Low-level function used by ::math::bignum::lshift
414 # Right shift 'z' of 'n' atoms. Low-level function used by ::math::bignum::lshift
423 set atoms [llength $z]
425 for {set j 2} {$j < $atoms} {incr j} {
441 set atoms [llength $z]
443 for {set j [expr {$atoms-1}]} {$j >= 2} {incr j -1} {
455 set atoms [expr {$n / $::math::bignum::atombits}]
457 ::math::bignum::lshiftBits [math::bignum::lshiftAtoms $z $atoms] $bits
463 set atoms [expr {$n / $::math::bignum::atombits}]
471 for {set j [expr {$atoms+1}]} {$j >= 2} {incr j -1} {
478 set t [lindex $z [expr {$atoms+2}]]
485 set newz [::math::bignum::rshiftBits [math::bignum::rshiftAtoms $z $atoms] $bits]
580 set atoms [::math::bignum::atoms $z]
581 set bits [expr {($atoms-1)*$::math::bignum::atombits}]
582 set atom [lindex $z [expr {$atoms+1}]]
643 set atoms [::math::bignum::atoms $n]
645 set j $atoms
793 set atoms [expr {($bits+$::math::bignum::atombits-1)/$::math::bignum::atombits}]
794 set shift [expr {($atoms*$::math::bignum::atombits)-$bits}]
796 while {$atoms} {
798 incr atoms -1