[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] En pudsig ting med modulus



In <sslug@sslug> sslug@sslug (Niels Muller Larsen) writes:

>Jeg havde et problem, lidt tid lyst til at eksperimentere lidt. Se her:

>Here we go with mother C
> 
>13 (mod 5) = 3
>-13 (mod 5) = -3
>13 (mod -5) = 3
>-13 (mod -5) = -3

[snip andre eksempler]

En diskussion af hvad modulo-funktionen egentlig gør og hvorfor man får 
forskellige resultater med negative tal fandt jeg her:
http://mathforum.org/library/drmath/view/52343.html
(bare skip forbi den indledende diskussion om Excel og Lotus).

Den korte udgave er at "modulo" IKKE er det samme som "divisions-rest".
Nogle computer-sprog (Ada nævnes) har explicit en funktion til hver
af disse operationer.


Mvh,
Henrik



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2006-10-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *