Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Hermann Riemann Newsgroups: de.alt.folklore.computer Subject: Re: Analoge Digitalanzeige? Date: Thu, 13 Jul 2023 16:51:46 +0200 Lines: 53 Message-ID: References: <87a5x1uy0v.fsf@usenet.ankman.de> <2cb6mj-rtf.ln1@news.informatik.uni-stuttgart.de> <875y79o6zs.fsf@usenet.ankman.de> <87bkh12son.fsf@angel.huemmer.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net AHuDS/k+847gi3lHy3T5iwiSOt6JwJpvDHH7lC3IWYmBerS9nO Cancel-Lock: sha1:jln6qaI5fcxOQshsbSf+Qu1EhdA= sha256:z6+DSD56H3gB3/Mt1UDCubwfwy17ovP3yonvXqgxGjE= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: de-DE, en-US In-Reply-To: Xref: csiph.com de.alt.folklore.computer:41251 Am 13.07.23 um 16:07 schrieb Stefan Ram: > Hermann Riemann writes: >> Versuche mal einem computer per Programm derartige >> Dezimalrechnung beizubringen, >> ohne hardware Arithmetik zu verwenden. > > Python > > from fractions import Fraction > print( Fraction( 1, 3 )* 60 ) > > Ausgabe > > 20 > > C++ > > #include > #include > #include > > static_assert > ( > ::std::ratio_equal_v > < ::std::ratio_multiply< ::std::ratio< 1, 3 >,::std::ratio< 60 >>, > ::std::ratio< 20 >> > ); > > int main() > { ::std::cout << > ::std::ratio_multiply<::std::ratio< 1, 3 >,::std::ratio< 60 >>::num > << '\n'; } > > Ausgabe > > 20 > Ich schrieb "ohne hardware Arithmetik" In einer Listenstruktur befindet sich das kleine Einmal eins In einer anderen Formeln wie z.B [ * [ / a b ] c = [ / [ * a c ] b ] Und Zerlegungen wie [ a b ]= [+ [ * a 10 ] b ] Und das Entsprechende mit , .. usw. Das effektive editieren mit suchen, einfügen, ersetzen halte ich für einen wesentlichen Intelligenzteil -- http://www.hermann-riemann.de