Category talk:Wren-long: Difference between revisions

→‎Source code: Added some more constants and 'dim' method.
m (No need for ULong qualifier.)
(→‎Source code: Added some more constants and 'dim' method.)
Line 64:
static four { lohi_( 4, 0) }
static five { lohi_( 5, 0) }
static six { lohi_( 6, 0) }
static seven { lohi_( 7, 0) }
static eight { lohi_( 8, 0) }
static nine { lohi_( 9, 0) }
static ten { lohi_(10, 0) }
 
Line 141 ⟶ 145:
if (!(b is ULong)) b = new(b)
return (a < b) ? a : b
}
 
// Returns the positive difference of two ULongs.
static dim(a, b) {
if (!(a is ULong)) a = new(a)
if (!(b is ULong)) b = new(b)
if (a >= b) return a - b
return zero
}
 
Line 671 ⟶ 683:
Fiber.abort("Argument must be a positive integer.")
}
if (n == 1) return this.copy()
var t = copy()
n = n - 1
Line 1,136 ⟶ 1,148:
static four { sigma_( 1, ULong.four) }
static five { sigma_( 1, ULong.five) }
static six { sigma_( 1, ULong.six) }
static seven { sigma_( 1, ULong.seven) }
static eight { sigma_( 1, ULong.eight) }
static nine { sigma_( 1, ULong.nine) }
static ten { sigma_( 1, ULong.ten) }
 
Line 1,174 ⟶ 1,190:
if (!(b is Long)) b = new(b)
return (a < b) ? a : b
}
 
// Returns the positive difference of two Longs.
static dim(a, b) {
if (!(a is Long)) a = new(a)
if (!(b is Long)) b = new(b)
if (a >= b) return a - b
return zero
}
 
Line 1,328 ⟶ 1,352:
 
// Returns the absolute value of 'this'.
abs { isNegative ? -this : this.copy() }
 
// The inherited 'clone' method just returns 'this' as Long objects are immutable.
9,476

edits