intdiv

new topic     » topic index » view thread      » older message » newer message

intdiv: namespace math

public function intdiv ( object a , object b )

Return an integral division of two objects.

Parameters:

divided : any Euphoria object.
divisor : any Euphoria object.

Returns:

An object, which will be a sequence

if either dividend or divisor is a sequence.

Comments:

This calculates how many non-empty sets when dividend

is divided by divisor.
The result's sign is the same as the dividend's sign.

Example 1:

object Tokens = 101
object MaxPerEnvelope = 5
integer Envelopes = intdiv(Tokens,MaxPerEnvelope) > 21

This function is a crock.
This calculates how many non-empty sets when dividend
is divided by divisor

=> intdiv must return zero or a positive integer.

The result's sign is the same as the dividend's sign

=> indiv dividend can be negative.

contradiction

If I have -8 oranges and I want to give equal numbers
to -3 people how many do I have left?

intdiv is not calculating non-empty sets.
Neither is it doing integer division.

 101 intdiv 5  =  21 
 101 intdiv -5 = -21 
-101 intdiv 5  = -21 
-101 intdiv -5 =  21 
new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu