[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: [CPROG] Sammenligning af to tal



----- Original Message -----
From: vaerge <sslug@sslug>
To: <sslug@sslug>
Sent: 15. marts 1999 22:32
Subject: [CPROG] Sammenligning af to tal


>I forbindelse med valgfrit emne i 3.g syntes jeg
>det kunne være sjovt at lave et program der
>beregner pi med d decimaler.
>Selve teorien bag beregningen er ganske sim-
>pel, men så er det jeg skal sammenligne to
>værdier af pi, kn og Kn, som jeg lige har beregnet,
>for at se om de er ens på de d decimaler.

Ok, bare for at test om jeg her forstået rigtigt...

Du skal checke om de to er ens op til og med den
d'te decimal?

>Er der en indbygget funktion der kan gøre dette
>eller er der nogen der har forslag til hvordan det
>ellers kan løses (jeg regner med at benytte
>'double' som den variabel der skal indeholde de to
>værdier af pi.
>

Jeg kan ikke umiddelbart komme på en brugbar funktion...
Men hvis jeg har forstået problemet korrekt kan du bare
beregne foreskellen ml. de to værdier. Hvis forskellen er
mindre end 1 / (10 ^ d) er tallene ens op til og med mindst
den d'te decimal.

M.v.h.,
Sune Kirkeby




 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:07 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] *